多个字段拼接成一个字段进行查询
SELECT
CONCAT(area.name,
house.block,
'栋',
house.unit,
'单元',
house.room_number,
'室',
room.apart_name) AS name,
FROM
house_apart AS room;
查询结果
name
'上海2栋1单元1室Aaa'
'上海2栋1单元1室A1'
本文共 235 字,大约阅读时间需要 1 分钟。
多个字段拼接成一个字段进行查询
SELECT
CONCAT(area.name,
house.block,
'栋',
house.unit,
'单元',
house.room_number,
'室',
room.apart_name) AS name,
FROM
house_apart AS room;
查询结果
name
'上海2栋1单元1室Aaa'
'上海2栋1单元1室A1'
转载于:https://blog.51cto.com/jinliang/1951095