Reputation: 11
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?
Upvotes: 1
Views: 67
Reputation: 2037
You should try this instead:
SELECT * FROM RecipeInstructions WHERE RECIPE_ID_FK=1 ORDER BY INSTRUCTION_NUMBER ASC
Upvotes: 0
Reputation: 15095
WHERE needs to come before ORDER BY
SELECT * FROM RecipeInstructions
WHERE RECIPE_ID_FK=1
ORDER BY INSTRUCTION_NUMBER ASC
Upvotes: 3