WebDB - SQLLite LIKE 语法...逃避我
尝试这些:
tx.executeSql("SELECT * FROM Animal_Traits WHEREanimalNameLIKE%?%ORtraitLIKE%?%ORDERBYanimalName", [searchValue,searchValue],
用这个,我被告知语法在 % 符号上中断...所以如果我尝试这个:
tx.executeSql("SELECT * FROM Animal_Traits WHERE AnimalName LIKE '%'?'%' OR Trait LIKE '%'?'%' ORDER BY AnimalName", [searchValue, searchValue],
它告诉我 ? 符号上的语法中断...(猜猜第一个?)并且如果我尝试这个:
tx.executeSql("SELECT * FROM Animal_Traits WHERE AnimalName LIKE '%?%' OR Trait LIKE '%?%' ORDER BY AnimalName", [searchValue, searchValue],
它告诉我参数数量不匹配...grrr!
有人可以帮助我吗?
谢谢!
Trying these:
tx.executeSql("SELECT * FROM Animal_Traits WHERE animalName LIKE %?% OR trait LIKE %?% ORDER BY animalName", [searchValue, searchValue],
with THIS one, I am told that the syntax breaks on the % symbol...so if I try THIS:
tx.executeSql("SELECT * FROM Animal_Traits WHERE animalName LIKE '%'?'%' OR trait LIKE '%'?'%' ORDER BY animalName", [searchValue, searchValue],
and it tells me the syntax breaks on the ? symbol... (guess the first one?) AND IF I TRY THIS:
tx.executeSql("SELECT * FROM Animal_Traits WHERE animalName LIKE '%?%' OR trait LIKE '%?%' ORDER BY animalName", [searchValue, searchValue],
It tells me that the number of arguments do not match... grrr!
Can someone help me please.
thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要这样做:
||
是一个字符串连接器。问号应该在引号之外。You need to do this:
The
||
is a string concatenator. And the question mark should be outside of the quotes.