Sql Server中Order By列明不明确

时间:2020-01-10 13:36:11   收藏:0   阅读:171

技术分享图片

 

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

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

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

        (2)order by CreateDateTime

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

 

解决方案:添加别名

技术分享图片

原文:https://www.cnblogs.com/yxcn/p/12175522.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!