sqlRst="select * frokm food where id='"+x+"' and name='"+y+"' and age='"+y+"'"哪里有错阿?

jamescheng 2002-05-08 05:19:34
sqlRst="select * frokm food where id='"+x+"' and name='"+y+"' and age='"+y+"'"哪里有错阿?
错误类型: 语法错误! 'and'附近
...全文
33 4 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
js_ning_cn 2002-05-11
  • 打赏
  • 举报
回复
sqlRst="select * frokm food where id='"+x+"' and name='"+y+"' and age='"+y+"'"
就是这里了
name='"+y+"' and age='"+y+"'"
name varchar2
age number
y 是什么类型的呢,类型不匹配,当然出错了

microsoft_windows 2002-05-08
  • 打赏
  • 举报
回复
有谁的名字和年龄是一样的?

最后一个and应该是or

再后面再加上 and id='"+x+"'"
Bogues 2002-05-08
  • 打赏
  • 举报
回复
:)
可乐加水 2002-05-08
  • 打赏
  • 举报
回复
sqlRst="select * frokm food where id='"+x+"' and name='"+y+"' and age='"+y+"'"
from写成frokm 了还看不出来?
还有,如果id,age是整型的话是不能加单引号的

81,122

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧