我似乎无法找到我错过运营商的地方。我已经多次看了这个,我尝试过引号,双引号,检查字段名称,我没有选择。
以下是" SQL1"正在创建,这很好。
SELECT ID, Result, (SELECT COUNT(*) FROM Table1 G WHERE G.Result <> GR.Result AND G.ID <= GR.ID) AS RunGroup FROM Table1 AS GR;
以下是&#34; SQL2&#34;正在创建,这也运行良好。
SELECT Result, MIN(ID) AS StartID, MAX(ID) AS EndID, COUNT(*) AS Games FROM SQL1 AS A GROUP BY Result, RunGroup ORDER BY Min(ID);
当涉及到这个查询时,会说语法错误,缺少运算符,然后突出显示&#34;结果&#34;。
SELECT TOP 1 * FROM SQL2 A ORDER BY Games, WHERE Result = "W";
建议?
答案 0 :(得分:1)
试试这个:
SELECT TOP 1 * FROM SQL2 A WHERE Result = 'W' ORDER BY Games;