开发者

Android SQL problem

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜