
正文
sql 同一行中,不同结果在不同列显示
提示:扫一扫查出行【扫一扫了解最新限行尾号】
复制提示
对不同条件查询到的结果在同一行中展示
尝试写过使用","和inner join两种方式,感觉使用","的更加直观
select table1.guid, table1.content name, table2.content sex,
table3.content age from
(
select guid, content
from table
where type='姓名'
) table1
,(
select guid, content
from table
where type='性别'
) table2
,(
select guid, content
from table
where type='年龄'
) table3
where table1.guid = table2.guid
and table2.guid = table3.guid







