2013年7月29日 星期一

PSQL string concate

1. Solution:
A. Using || symbol
select account||lastname from user where account = 'andy';







B. write the function
create or replace function concate(text,text) RETURNS text AS $$ SELECT $1 || '' ||$2; $$ LANGUAGE 'sql';
select concate(account,lastname) from user where account = 'andy';




Reference:
a-better-concat-for-postgresql
How to concatenate strings of a string field in a PostgreSQL
wiki Postsql

沒有留言:

張貼留言