Talk:String concatenation: Difference between revisions

From Rosetta Code
Content added Content deleted
(select into?)
m (format)
Line 1: Line 1:
SQL has string concatentation using infix || in the style of PL/1 but does not have variables as such.
SQL has string concatentation using infix || in the style of PL/1 but does not have variables as such.


<lang sql>create table foo ( a varchar(10),b varchar(10));

create table foo ( a varchar(10),b varchar(10));
insert into foo values ('hello','dolly'),('l8r','g8r');
insert into foo values ('hello','dolly'),('l8r','g8r');
select 'greeting is ' ||a ,a ||' '|| b from foo;
select 'greeting is ' ||a ,a ||' '|| b from foo;</lang>
:What about select into? I was never sure how SQL-fu like that worked, though. --[[User:Mwn3d|Mwn3d]] 04:58, 16 November 2010 (UTC)
:What about select into? I was never sure how SQL-fu like that worked, though. --[[User:Mwn3d|Mwn3d]] 04:58, 16 November 2010 (UTC)

Revision as of 10:46, 16 November 2010

SQL has string concatentation using infix || in the style of PL/1 but does not have variables as such.

<lang sql>create table foo ( a varchar(10),b varchar(10)); insert into foo values ('hello','dolly'),('l8r','g8r'); select 'greeting is ' ||a ,a ||' '|| b from foo;</lang>

What about select into? I was never sure how SQL-fu like that worked, though. --Mwn3d 04:58, 16 November 2010 (UTC)