select m.*,l.name,l.cid from message m,list l where m.lid=l.id and (l.cid=0 OR l.cid='1') and rownum<=10
minus
select m.*,l.name,l.cid from message m,list l where m.lid=l.id and (l.cid=0 OR l.cid='1') and rownum<=0 order by l.cid--查询字段中加上l.cid
不知道楼主的这个查询是干什么用的.后一句用rownum<=0 ??
minus
select m.*,l.name,l.cid from message m,list l where m.lid=l.id and (l.cid=0 OR l.cid='1') and rownum<=0 order by l.cid--查询字段中加上l.cid
不知道楼主的这个查询是干什么用的.后一句用rownum<=0 ??
無法確定是哪個表1的cid而言的
所以會報錯无效列名
select * from
(
select
rownum as row_num,m.*,l.name,l.cid
from
message m,list l
where m.lid=l.id
and (l.cid=0 OR l.cid='1')
) a
where a.rownum between 0 and 10
order by a.cid
(
select
rownum as row_num,m.*,l.name,l.cid
from
message m,list l
where m.lid=l.id
and (l.cid=0 OR l.cid='1')
) a
where a.row_num between 0 and 10
order by a.cid