Oracle查询出来的数据只取第一条和最后一条

结合oracer by和rownum来做:

--第一条
select * from bdatag_tag order by tag_id where rownum = 1;
--最后一条
select * from bdatag_tag order by tag_id desc where rownum = 1;

 

你可能感兴趣的:(oracle)