sql like query in query [英] sql like operator in query
本文介绍了sql like query in query的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
选择 * 来自 表 其中 loc = //这里我有 实现逻辑
表loc列中的
有像locations.so这样的值我需要检索''a''和's'之间的位置。所有位置具有a和s之间的值。
解决方案
这是你需要的查询
选择 * 来自 表 其中 locname ' a%' 和 ' s%'
订单 by locname
Enjoy&快乐的编码:)
你想要所有以a开头并以s结尾的位置吗?
如果是,在这里是查询。
选择 * 来自 table 其中 loc LIKE ' a%s'
select * from table where loc=//here i have to implement logic
in table loc column have values like locations.so i need to retrieve location between ''a'' and ''s''.all the location having value between a and s .
解决方案
Here ''s your required query
select * from table where locname between 'a%' and 's%' order by locname
Enjoy & happy coding :)
Do you want all the location that starts with a and ends with s?
If yes, here''s the query.
select * from table where loc LIKE 'a%s'
这篇关于sql like query in query的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文