我正在使用 SQL Server。我有以下查询:
select
convert(varchar(10), MAX(closedate), 101)
from
(select PSer.Signin_Date as closedate
from PSer
where ID = '12')
请注意,我的 from 中的内容比我拥有的简化版本更复杂。
我收到一条消息说
无效的列名已关闭
我正在使用 SQL Server。我有以下查询:
select
convert(varchar(10), MAX(closedate), 101)
from
(select PSer.Signin_Date as closedate
from PSer
where ID = '12')
请注意,我的 from 中的内容比我拥有的简化版本更复杂。
我收到一条消息说
无效的列名已关闭
确保你给你的子查询一个别名。
from ( select PSer.Signin_Date as closedate from PSer where ID = '12') AS SOMENAME
用这个:
select convert(varchar(10),MAX(t1.closedate),101)
from ( select PSer.Signin_Date as closedate from PSer where ID = '12') as t1
请享用。