我有2个表,2个表里面有名称相同的字段,也就是外键select * from(
select * from loginuser a, orgtree b ***后面条件略去
) where rownum<=1总是报未明确指定列,我该怎么写啊
select * from loginuser a, orgtree b ***后面条件略去
) where rownum<=1总是报未明确指定列,我该怎么写啊
调试欢乐多
select * from(
select col1,col2,col3 from loginuser a, orgtree b ***后面条件略去
) where rownum<=1
select * from loginuser a, orgtree b ***后面条件略去
) T where rownum<=1
select * from loginuser a, orgtree b ***后面条件略去
)T where rownum<=1
select * from loginuser a, orgtree b ***后面条件略去
) as t where rownum<=1别名别忘记了
SignatureManagePO po = new SignatureManagePO();
String sql = "select * from(" +
"select * from signaturemanage a, sheetwkflowstatus b, loginuser c where b.sheetnmbr='" + sheetnmbr + "' and b.userid = "+ userid +" and b.userid = c.userid and b.exittimestamp is not null and c.userid = a.userid and a.disabled = 0 order by b.swsid) where rownum <= 1";
Result result = super.retrieve(sql, po);
return (SignatureManagePO) result.getBeans();
}怎么改?
?
select *
from(
select * --列名应该有重复
from signaturemanage a
,sheetwkflowstatus b
,loginuser c
where b.sheetnmbr='ddddd'
and b.userid = eeeee
and b.userid = c.userid
and b.exittimestamp is not null
and c.userid = a.userid
and a.disabled = 0
order by b.swsid
) a --少了别名
where rownum <= 1;--rounum列可能不存在
where rowNum<=1 改成这样试一下