日期:2014-05-19  浏览次数:20365 次

这句sql语句报错,为什么,那位能说说缘由
SELECT           right( '00000 '+cast(dbo.ApexCoreUser.apexId   as   varchar(10)),5)   as   dbo.ApexCoreUser.apexId   from   jwc_view2

------解决方案--------------------
SELECT right( '00000 '+cast(dbo.ApexCoreUser.apexId as varchar(10)),5) as dbo.ApexCoreUser.apexId from jwc_view2

as是给该列起别名
肯定不能用dbo.ApexCoreUser.apexId
SELECT right( '00000 '+cast(dbo.ApexCoreUser.apexId as varchar(10)),5) as apexId from jwc_view2
这样试试?
------解决方案--------------------
SELECT right( '00000 '+cast(dbo.ApexCoreUser.apexId as varchar(10)),5) apexId from jwc_view2

这样也是可以的。。。。。
主要就是你对as的理解不够深