建你贴出数据这样方便表达和测试结果。select t.taskid, t.manaidfk, p.execidfk,p.percent,t.endtime from 任务信息表 t,任务进度表 p where t.taskid=p.t.taskidFk where t.manaidfk='xxx' and p.execidfk='zzz'
上面语句多了个where,换成andselect t.taskid, t.manaidfk, p.execidfk,p.percent,t.endtime from 任务信息表 t,任务进度表 p where t.taskid=p.t.taskidFk and t.manaidfk='xxx' and p.execidfk='zzz'
或者用join , inner join 或者 left join 根据你实现情况选择select t.taskid, t.manaidfk, p.execidfk,p.percent,t.endtime from 任务信息表 t left join 任务进度表 p on t.taskid=p.t.taskidFk where t.manaidfk='xxx' and p.execidfk='zzz'
select t.taskid, t.manaidfk, p.execidfk,p.percent,t.endtime from 任务信息表 t,任务进度表 p where t.taskid=p.t.taskidFk and t.manaidfk='xxx' and p.execidfk='zzz'
from 任务信息表 t,任务进度表 p
where t.taskid=p.t.taskidFk
where t.manaidfk='xxx'
and p.execidfk='zzz'
from 任务信息表 t,任务进度表 p
where t.taskid=p.t.taskidFk
and t.manaidfk='xxx'
and p.execidfk='zzz'
from 任务信息表 t left join 任务进度表 p on t.taskid=p.t.taskidFk
where t.manaidfk='xxx'
and p.execidfk='zzz'
select t.taskid, t.manaidfk, p.execidfk,p.percent,t.endtime
from 任务信息表 t,任务进度表 p
where t.taskid=p.t.taskidFk
and t.manaidfk='xxx'
and p.execidfk='zzz'