如果指定了 SELECT DISTINCT,那么 ORDER BY
子句中的项就必须出现在选择列表中,否则会出现错误。
比如
SQL语句:SELECT DISTINCT Company FROM Orders order by Company ASC是可以正常执行的。
但是如果SQL语句是:SELECT DISTINCT Company FROM Orders order by Num ASC是不能正确执行的,在ASP中会提示“ORDER BY 子句与 (Num) DISTINCT 冲突”错误。