MySQL: concat string 

Joined:
04/09/2007
Posts:
776

March 07, 2011 16:23:40    Last update: March 07, 2011 16:25:05
Oracle operator || doesn't work for MySQL. Looks like I have to use the concat function:
mysql> select 'abc' || '123';
+----------------+
| 'abc' || '123' |
+----------------+
|              1 |
+----------------+
1 row in set, 1 warning (0.00 sec)

mysql> select concat('abcd', '1234');
+------------------------+
| concat('abcd', '1234') |
+------------------------+
| abcd1234               |
+------------------------+
1 row in set (0.00 sec)

mysql> select concat('abcd', '1234', 'zzz');
+-------------------------------+
| concat('abcd', '1234', 'zzz') |
+-------------------------------+
| abcd1234zzz                   |
+-------------------------------+
1 row in set (0.00 sec)
Share |
| Comment  | Tags