我想写一条SQL语句,根据条件查找日期最大的五条出来,
我写的:
select * from school_news n where n.offshoot_id='1' and (n.type='1' or n.type='2' or n.type= '3' or n.type= '5 ') and n.indate= (select max(s.indate) from school_news s)
只查出一条,怎么限制五条?
请过路高手指点!谢谢!
...全文
362打赏收藏
请高手指点!谢谢!
我想写一条SQL语句,根据条件查找日期最大的五条出来, 我写的: select * from school_news n where n.offshoot_id='1' and (n.type='1' or n.type='2' or n.type= '3' or n.type= '5 ') and n.indate= (select max(s.indate) from school_news s) 只查出一条,怎么限制五条? 请过路高手指点!谢谢!