我想从数据库里查找出日期最大的前五条信息出来,该怎么写?
我写的是:select * from news n where n.type=1 and n.date=(select max(n.date) from news ..........)
之后该怎么写才能得到前五条呢?
请过路高手指点?
我写的是:select * from news n where n.type=1 and n.date=(select max(n.date) from news ..........)
之后该怎么写才能得到前五条呢?
请过路高手指点?
这就行了
select top 5 * 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) 不能执行,我用的mysql数据库
select * from news n where n.type=1 order by date limit 1,5;