Difference between revisions of "FR/FAQ/Base/117"
From Apache OpenOffice Wiki
(→Quels codes SQL utiliser pour concaténer deux champs ?) |
(Ajout possibilité avec CHAR()) |
||
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" |
Revision as of 13:20, 8 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"