Sql Server中Order By列明不明确

 在sql sever中执行这段语句时提示CreateDateTime列明不明确

缘由:执行顺序:(1) select CreateDateTime,* from Lambor_Users.dbo.MasterProfitLossSettleList

    查出结果集之后,再次执行:

        (2)order by CreateDateTime

由此可看出:(1)执行结果集中产生了两个CreateDateTime列段,则导致order by不明确

解决方案:添加别名

猜你喜欢

转载自www.cnblogs.com/yxcn/p/12175522.html