关于分页的SQL语句问题,高手帮帮忙
语句如下,错误:单行子查询返回多个行,不知怎么改,请高手帮帮忙select*from(selectrow_.*,rownumrownum_from(selectPROBL...
语句如下,错误:单行子查询返回多个行,不知怎么改,请高手帮帮忙
select * from (
select row_.*, rownum rownum_ from (
select PROBLEM_ID as problem_id, PROBLEM_NAME as problem_name, PROBLEM_CONTENT as problem_content, USER_ID as user_id
, (select u.user_name from usertable u where u.user_id = t.user_id) as user_name
, (select c.attr_name from c_attr c where c.remark1 = t.lingyu) as lingyu
, IS_OPEN as is_open, IS_ASSIGN as is_assign, PROBLEM_TYPE as problem_type, IS_CHECK as is_check
, (select tt.name from testtree tt where tt.id = t.professional_id) as professional_name
, to_char(problem_date,'YYYY-MM-DD') as problem_date, is_answer as is_answer
from (select * from problem_list order by PROBLEM_DATE desc ) t
where t.is_difficute = '是'
and is_answer='否'
)row_ where rownum<=30
) where rownum_>=21
....数据库表结构问题 谁随便回答下 让我结贴吧 展开
select * from (
select row_.*, rownum rownum_ from (
select PROBLEM_ID as problem_id, PROBLEM_NAME as problem_name, PROBLEM_CONTENT as problem_content, USER_ID as user_id
, (select u.user_name from usertable u where u.user_id = t.user_id) as user_name
, (select c.attr_name from c_attr c where c.remark1 = t.lingyu) as lingyu
, IS_OPEN as is_open, IS_ASSIGN as is_assign, PROBLEM_TYPE as problem_type, IS_CHECK as is_check
, (select tt.name from testtree tt where tt.id = t.professional_id) as professional_name
, to_char(problem_date,'YYYY-MM-DD') as problem_date, is_answer as is_answer
from (select * from problem_list order by PROBLEM_DATE desc ) t
where t.is_difficute = '是'
and is_answer='否'
)row_ where rownum<=30
) where rownum_>=21
....数据库表结构问题 谁随便回答下 让我结贴吧 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询