SELECT zal06 FROM zal_file A
WHERE zal01 = 'cxcq430' AND zal06 IS NOT NULL
AND zal03 = '2' AND zal07 = 'Y'
AND zal02 = (
SELECT MAX(B.zal02) FROM zal_file B
WHERE B.zal01 = A.zal01
AND B.zal03=A.zal03
AND B.zal06=A.zal06 AND B.zal07 = A.zal07
)
ORDER BY zal02
http://my.csdn.net/wolililaile2/album/detail/1133399# ------其他解决方案-------------------- 用max函数是返回一个结果啊,不知你想问啥。。。 ------其他解决方案-------------------- SELECT zal06 FROM zal_file A
WHERE zal01 = 'cxcq430' AND zal06 IS NOT NULL
AND zal03 = '2' AND zal07 = 'Y'
AND zal02 = (
SELECT MAX(B.zal02) FROM zal_file B
WHERE B.zal01 = A.zal01
AND B.zal03=A.zal03
AND B.zal06=A.zal06 AND B.zal07 = A.zal07
)
ORDER BY zal02