同时使用Like和In子句 [英] Use of both Like and In clause

查看:149
本文介绍了同时使用Like和In子句的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在sql命令中同时使用like和In子句

[edit]仅标记-OriginalGriff [/edit]

How to use both like and In clause in sql command

[edit]Tags only - OriginalGriff[/edit]

推荐答案

当您想在SQL WHERE子句中指定搜索条件时,LIKE子句非常有用,基于列内容的一部分,其中IN子句允许您在SQL WHERE搜索条件中指定离散值.
查看给定的链接 SQL_Like [ SQL_IN [ ^ ]至阅读包含优秀示例的优秀文章.
The LIKE clause is very useful when you want to specify a search condition within your SQL WHERE clause, based on a part of a column contents where as The IN clause allows you to specify discrete values in your SQL WHERE search criteria.
take a look at given link SQL_Like[^] and SQL_IN[^] to read an excellent articles which embedded good examples.


在没有上下文的情况下,回答起来并不容易.还是要从这里开始.

Without the context, it is not easy to answer. Still, here is something to start with.

Select Col1 from table1 where Col2 in (''value1'',''value2'') and col3 like ''val%''





Select Col1 from table1 where ((Col2 in (''value1'',''value2'')) or (col2 like ''Other%''))




更新:您尝试 [




Update: You try it this[^] way.


这篇关于同时使用Like和In子句的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆