SQL语句中CONCAT(字符串连接函数)的用法
(2012-05-28 09:04:39)
标签:
杂谈 |
分类: 我的php成长笔记 |
CONCAT(字串1, 字串2, 字串3, ...): 将字串1、字串2、字串3,等字串连在一起。
例如:
Geography 表格
region_name
store_name
East
Boston
East
New York
West
Los Angeles
West
San Diego
例子1:
MySQL/Oracle:
SELECT CONCAT(region_name,store_name) FROM Geography
WHERE store_name = 'Boston';
结果:
'EastBoston'
例如:
Geography 表格
region_name
East
East
West
West
例子1:
MySQL/Oracle:
SELECT CONCAT(region_name,store_name) FROM Geography
WHERE store_name = 'Boston';
结果:
'EastBoston'

加载中…