想查找符合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