情况1:
列表sql: select 栏名1 from (select 子栏名1 from 表1 where 条件1) temp
单值sql: select 栏名2 from (select 子栏名2 from 表1 where 表1.id = xxx) temp
改造后的sql:
select 栏名1, 栏名2 from (select 子栏名1, 子栏名2 from 表1 where 条件1)
情况2:
列表sql: select 栏名1 from (select 子栏名1 from 表1 where 条件1) temp
单值sql: select count(1) from 表2 where 条件2
改造后的sql: (将单值sql作为列表sql的栏名来弄就行, 其他与列表sql一致)
select 栏名1, (单值sql) 别名 from … (注意这里的单值sql不能用join方式的表连接, 要用表连接的话 必须用where的方式, 不然会报错)
单值sql:
列表sql:
合并sql: