Difference between revisions of "FR/FAQ/Base/117"
From Apache OpenOffice Wiki
(→Quels codes SQL utiliser pour concaténer deux champs ?) |
m |
||
(One intermediate revision by one other user not shown) | |||
Line 9: | Line 9: | ||
CONCAT( "Animateurs"."Prenom" || ' ' || "Animateurs"."Nom" ) | CONCAT( "Animateurs"."Prenom" || ' ' || "Animateurs"."Nom" ) | ||
− | |||
CONCAT( CONCAT( "Animateurs"."Prenom", ' ' ), "Animateurs"."Nom" ) | CONCAT( CONCAT( "Animateurs"."Prenom", ' ' ), "Animateurs"."Nom" ) | ||
"Prenom" + SPACE( 1 ) + "Nom" | "Prenom" + SPACE( 1 ) + "Nom" | ||
+ | |||
+ | "Prenom" + CHAR( 32 ) + "Nom" | ||
+ | |||
+ | |||
+ | [[Category: FR/Documentation/FAQ/Base]] |
Latest revision as of 16:10, 28 October 2009
Quels codes SQL utiliser pour concaténer deux champs ?
Soit une Base avec une Table Animateurs contenant, outre un champ pour la clé primaire, un champ Nom et un champ Prenom.
La requête de concaténation de ces deux champs peut être réalisée de trois façons.
Les solutions testées pour HSQLDB :
CONCAT( "Animateurs"."Prenom" || ' ' || "Animateurs"."Nom" )
CONCAT( CONCAT( "Animateurs"."Prenom", ' ' ), "Animateurs"."Nom" )
"Prenom" + SPACE( 1 ) + "Nom"
"Prenom" + CHAR( 32 ) + "Nom"