首先:
select id, lb, subject, nowuser from listlb有三个状态1,2,3
lb为3时继续查询表中字段,把done='ready' and xh=’1’ 与其他的结果区分开有办法统一到一个sql语句中吗?
select id, lb, subject, nowuser from listlb有三个状态1,2,3
lb为3时继续查询表中字段,把done='ready' and xh=’1’ 与其他的结果区分开有办法统一到一个sql语句中吗?
以lb区分结果
lb为3种状态,应该得到三种结果
我现在想再查询表,将lb=3的状态再分为两种状态list 和 表有一项id是一样的值
select a.lb, decode(b.done, 'ready', decode(b.xh, '1', '1', '0'), '0') /*加上单行函数*/
from list a, b
where a.id = b.id
group by a.lb, decode(b.done, 'ready', decode(b.xh, '1', '1', '0'), '0')