选择.....在哪里..或 [英] Select ..... where .... OR

查看:83
本文介绍了选择.....在哪里..或的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有一种方法可以选择在同一字段上出现多个条件中的任何一个条件的数据?

Is there a way to select data where any one of multiple conditions occur on the same field?

示例:我通常会编写如下语句:

Example: I would typically write a statement such as:

select * from TABLE where field = 1 or field = 2 or field = 3

有没有办法像这样说:

select * from TABLE where field = 1 || 2 || 3

感谢您的帮助.

推荐答案

当然,最简单的方法是:

Sure thing, the simplest way is this:

select foo from bar where baz in (1,2,3)

这篇关于选择.....在哪里..或的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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