1

I have this sql statement

SELECT *
  FROM RecipeInstructions
 ORDER BY INSTRUCTION_NUMBER ASC
 WHERE RECIPE_ID_FK=1

execute it using rawquery - have exception... Syntax error near WHERE... Why?

3 Answers 3

3

WHERE needs to come before ORDER BY

SELECT * FROM RecipeInstructions
WHERE RECIPE_ID_FK=1
ORDER BY INSTRUCTION_NUMBER ASC 
Sign up to request clarification or add additional context in comments.

Comments

1

Just a guess, but shouldn't the WHERE be before the ORDER BY?

Comments

0

You should try this instead:

SELECT * FROM RecipeInstructions WHERE RECIPE_ID_FK=1 ORDER BY INSTRUCTION_NUMBER ASC

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.