oracle分页多表查询语句
有两张表 t_topic
id tname creattime
t_news
id tid title author ncontent
tid是外键
现在要做一个分页
查出
tname title author 这几个列
怎么写sql语句
SELECT * FROM ( SELECT A.*, ROWNUM RN FROM( SELECT t.tname, n.title, n.author FROM t_topic t, t_news n WHERE t.id = n.tid) ) WHERE RN BETWEEN 21 AND 40;图书管理系统论文
SELECT * FROM (
SELECT A.*, ROWNUM RN FROM(
SELECT t.tname, n.title, n.author FROM t_topic t, t_news n
WHERE t.id = n.tid)A
)
WHERE RN BETWEEN 21 AND 40;
少了个A不错 还是有用的