开发者

Android SQL problem

开发者 https://www.devze.com 2023-03-31 05:18 出处:网络
I have this sql statement SELECT * FROM RecipeInstructions ORDER BY INSTRUCTION_NUMBER ASC WHERE RECIPE_ID_FK=1

I have this sql statement

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

execute it usin开发者_如何转开发g rawquery - have exception... Syntax error near WHERE... Why?


WHERE needs to come before ORDER BY

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


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


You should try this instead:

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

精彩评论

暂无评论...
验证码 换一张
取 消