以下代码:
SELECT JaguarStartupTime, CPU, AmountOfRam, UpdatedOn, *
FROM dbo.MachineConfiguration
WHERE ServerName = 'WashingtonDC01'
AND UpdatedOn > '11/21/2012'
ORDER BY JaguarStartupTime DESC
导致错误:Ambiguous column name 'JaguarStartupTime'
。
但是,删除ORDER BY
使其工作。此外,在ORDER BY
子句前面加上表格,如下所示,它也可以工作:
SELECT JaguarStartupTime, CPU, AmountOfRam, UpdatedOn, *
FROM dbo.MachineConfiguration
WHERE ServerName = 'WashingtonDC01'
AND UpdatedOn > '11/21/2012'
ORDER BY dbo.MachineConfiguration.JaguarStartupTime DESC
这对我来说从来没有意义。有人可以解释吗?