sql 语句问题 关键字 'as' 附近有语法错误。
WITHqueryAS(selectROW_NUMBER()OVER(orderbyup_optimedesc)row,convert(varchar(16),up_op...
WITH query AS (select ROW_NUMBER() OVER (order by up_optime desc)
row,convert(varchar(16),up_optime,120) as up_optime,up_paycode,
uo_note,up_paymoney,up_paypoundage,up_haspay,isnull(up_content,'')
as up_content,up_inout,up_busisort,up_busino,up_paymakeid,up_lottype,
up_wtype,up_adminnote,up_adminname from view_userpaylog inner join b_useriotype
on up_busino=uo_id where up_username = 'bighippo' and UP_optime between DATEADD
(mm, DATEDIFF(mm,0,getdate())-1, 0) and DATEADD(mm, DATEDIFF(mm,0,getdate()), 0 ))
as __hibernate_row_nr__, row_number() over ()
SELECT * FROM query WHERE __hibernate_row_nr__ BETWEEN '1' AND '51'
在倒数第二行 开始 AS
关键字 'as' 附近有语法错误。
求教 能帮我看看什么问题??
数据库 SqlServer2008 展开
row,convert(varchar(16),up_optime,120) as up_optime,up_paycode,
uo_note,up_paymoney,up_paypoundage,up_haspay,isnull(up_content,'')
as up_content,up_inout,up_busisort,up_busino,up_paymakeid,up_lottype,
up_wtype,up_adminnote,up_adminname from view_userpaylog inner join b_useriotype
on up_busino=uo_id where up_username = 'bighippo' and UP_optime between DATEADD
(mm, DATEDIFF(mm,0,getdate())-1, 0) and DATEADD(mm, DATEDIFF(mm,0,getdate()), 0 ))
as __hibernate_row_nr__, row_number() over ()
SELECT * FROM query WHERE __hibernate_row_nr__ BETWEEN '1' AND '51'
在倒数第二行 开始 AS
关键字 'as' 附近有语法错误。
求教 能帮我看看什么问题??
数据库 SqlServer2008 展开
3个回答
展开全部
with as 格式:
with tempname as (select ....)
select ...
--------------------------------------
as __hibernate_row_nr__, row_number() over () 这个不能用在这
with tempname as (select ....)
select ...
--------------------------------------
as __hibernate_row_nr__, row_number() over () 这个不能用在这
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
as __hibernate_row_nr__, row_number() over ()
这行出现的毫无说法,这是你写的代码吗?或许是copy的不全吧
这行出现的毫无说法,这是你写的代码吗?或许是copy的不全吧
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询