MySQL中有没有办法使用SELECT语句将文本连接到值?(就像在Oracle中一样)
例如,在Oracle中,您可以编写如下内容:
SQL> select 'The Year is '|| year, 'The month is '|| month from time where rownum < 2;
'THEYEARIS'||YEAR
----------------------------------------------------
'THEMONTHIS'||MONTH
-----------------------------------------------------
The Year is 2009
The month is 1
Run Code Online (Sandbox Code Playgroud)
Tru*_*ufa 15
SELECT Concat(vend_name, ' (', vend_country, ')')
FROM vendors
ORDER BY vend_name;
Run Code Online (Sandbox Code Playgroud)
阅读本教程:
http://www.brainbell.com/tutorials/MySQL/Concatenating_Fields.htm
| 归档时间: |
|
| 查看次数: |
17795 次 |
| 最近记录: |