Concatenating with PostgreSQL and MySQL

I got a table named mrhs84 with fields lname, fname, and section. I want to string them together into a single query field that looks like this: Calmada, Dong (A).

PostgreSQL select mrhs84.lname || ', ' || mrhs84.fname || ' (' || mrhs84.section || ')' as person from mrhs84;
MySQL select concat(mrhs84.lname,', ',mrhs84.fname,' (',mrhs84.section,')') as person from mrhs84;
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s