日期:2014-05-17 浏览次数:20754 次
(work.Id = 01 or work.workId in (select p.workId from table02 as p where p.PId=01))
------解决方案--------------------
select work.Id,work.workDate,work.beginTime
from table01 as work
where work.Id = 01
and work.isDel<>1
and work.workDate between ? and ?
union all
select work.Id,work.workDate,work.beginTime
from table01 as work,table02 as p
where p.PId=01 and work.workId = p.workId
and work.isDel<>1 and work.workDate between ? and ?
order by workDate,beginTime;