问题描述
每次我运行这个SQL时,它都会在查询表达式'row_number()中查询
-syntax错误(缺少运算符)(按RunTime排序)'
表名:EventsDetail
列:MemberID,EventNumber,RUnTime
adoqueryAdmin.SQL.Text:=选择EventNumber, MemberID,RunTime,ROW_NUMBER()OVER(ORDER BY RunTime)AS来自EventsDetail的地方,其中EventNumber =''AAA001''按RunTime订购'
如何解决它?
Everytime I run this SQL it says
-syntax error (missing operator) in query expression 'row_number() over (order by RunTime)'
Table Name:EventsDetail
Columns: MemberID, EventNumber, RUnTime
adoqueryAdmin.SQL.Text:=Select EventNumber,MemberID, RunTime, ROW_NUMBER() OVER (ORDER BY RunTime) AS Place from EventsDetail where EventNumber=''AAA001'' order by RunTime'
How do I solve it?
推荐答案
declare @Test Table
(
id int identity(1,1),
number int,
runtime time
)
insert into @Test values(1,'17:32:19')
insert into @Test values(2,'17:33:22')
insert into @Test values(3,'17:32:20')
Select Number,ID, runtime, ROW_NUMBER() OVER (ORDER BY runtime) AS Place
from @TEST where Number='1' order by runtime
工作正常。
its working fine.
这篇关于查询表达式'row_number()中的-syntax错误(缺少运算符)(按RunTime排序)'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!