我在 SQL Server 中有如下表。表名:土地
Land_ID UID DM_DATE DEL_REASON
1 5 2013-05-21 20:31:53.773 Reason1
1 1 2013-05-21 20:45:21.610 Reason2
1 1 2013-05-21 20:45:27.613 Reason3
我想获取最新 DM_DATE 的 DEL_REASON(获取上次输入日期的原因值),意思是(Reason3)。
我写了这个选择语句,但它给了我这个错误"An expression of non-boolean type specified in a context where a condition is expected, near ')'"
select [DEL_REASON] from [LANDS] where [Land_ID]='1' AND [UID] ='1' AND MAX([DM_DATE])
有人可以帮忙吗。