0

I can't seem to find where I'm missing an operator. I've looked at this many times, I tried signle quotes, double quotes, checked field names, I'm outta options.

Here is how "SQL1" is being created, this runs fine.

SELECT ID, Result, (SELECT COUNT(*) FROM Table1 G WHERE G.Result <> GR.Result AND G.ID <= GR.ID) AS RunGroup FROM Table1 AS GR;

Here is how "SQL2" is being created, this also runs fine.

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);

When it comes to this query, is says syntax error, missing operator, then highlights "Result".

SELECT TOP 1 * FROM SQL2 A ORDER BY Games, WHERE Result = "W";

Suggestions?

1
  • 1
    WHERE Result = "W" ORDER BY Games; in other words take out the comma and switch the 'where' and 'order by clauses' Commented Aug 4, 2014 at 15:49

1 Answer 1

1

try this :

SELECT TOP 1 * FROM SQL2 A WHERE Result = 'W' ORDER BY Games;
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.