符合条件的最小记录
问:
想查找符合qfno='100101' 条件, 且日期whdate为最小的记录,但用下面语句
SELECT * FROM SEAL where qfno='100101' and whdate in (select min(whdate) from seal )
出现日期为库内最小才查得出来,不知道哪里错误,请高手指教。
答:
SELECT a.* FROM SEAL a
where a.qfno='100101' and a.whdate in (select min(whdate) from seal where qfno =a.qfno )
select top 1 * from seal where qfno = '100101' order by whdate asc
| 感动 | 同情 | 无聊 | 愤怒 | 搞笑 | 难过 | 高兴 | 路过 |
- 上一篇:不在设计时加入pbd的情况下如何在程序中…
- 下一篇:没有了!
相关文章
-
没有相关内容

会员登录