
从数据库中读取字段值得问题
我从数据库中读取“tupian"这个字段的不为空的按时间倒序排列的前三个值,然后我再读取同一数据表中的排除已读取的三个的其他的值,sql语句该怎么写,写写...
我从数据库中读取“tupian"这个字段的不为空的按时间倒序排列的前三个值,然后我再读取同一数据表中的排除已读取的三个的其他的值,sql语句该怎么写,写写
展开
2个回答
展开全部
第一个
select top 3 * from tablename where tupian is not null order by [date]
第二个
select * from tablename where tupian is not null and id not in(select top 3 * from tablename where tupian is not null order by [date]) order by [date]
select top 3 * from tablename where tupian is not null order by [date]
第二个
select * from tablename where tupian is not null and id not in(select top 3 * from tablename where tupian is not null order by [date]) order by [date]
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询