25.12.2012 Views

Cours SGBD LAI2 - Institut supérieur d'informatique de Mahdia

Cours SGBD LAI2 - Institut supérieur d'informatique de Mahdia

Cours SGBD LAI2 - Institut supérieur d'informatique de Mahdia

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Fonctions Définitions Exemples Résultats<br />

length (chaîne) Nombre <strong>de</strong> caractères dans la<br />

chaîne<br />

instr(chaîne, sous-chaîne) Emplacement d’une sous-chaîne<br />

spécifiée dans une chaîne<br />

substr(chaîne, i, j) Extrait une sous-chaîne du i ème<br />

caractère jusqu’au j ème caractère<br />

lpad(chaîne, x [,text])<br />

Remplit chaîne pour avoir une<br />

chaîne <strong>de</strong> longueur x en ajoutant<br />

le text (un espace par défaut)<br />

length(‘Bonjour')<br />

instr(‘Bonjour', ‘j')<br />

substr(‘Bonjour', 1,3)<br />

lpad(sal,10, ‘*‘)<br />

Si chaîne a une taille<br />

<strong>supérieur</strong>e à x alors elle<br />

est tronquée<br />

Riadh HADJ M’TIR – 2011/2012 139<br />

7<br />

4<br />

Bon<br />

******5000<br />

rpad(chaîne, x [,text]) rpad(sal,10, ‘*') 5000******<br />

concat(chaîne1, chaîne2) Concaténer <strong>de</strong>s chaînes concat(‘Bon’,’jour’) Bonjour<br />

Trim([leading|trailing|both ]<br />

[caractère] FROM chaîne)<br />

Fonctions <strong>de</strong> manipulation <strong>de</strong> caractères<br />

Supprime la plus gran<strong>de</strong> chaîne<br />

contenant seulement<br />

les caractères (un espace par<br />

défaut) à partir du début, <strong>de</strong> la fin<br />

ou <strong>de</strong>s <strong>de</strong>ux extrémités <strong>de</strong><br />

la chaîne<br />

trim(‘S’ FROM<br />

‘SSSMITH’)<br />

trim(both 'x' from<br />

'xTomxx')<br />

MITH<br />

Tom

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!