日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

oracle中的in函数,Oracle中In函数的使用

發(fā)布時(shí)間:2024/7/19 编程问答 24 豆豆
生活随笔 收集整理的這篇文章主要介紹了 oracle中的in函数,Oracle中In函数的使用 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

SQL:?"IN"?Function

The?IN?function?helps?reduce?the?need?to?use?multipleORconditions.

譯:IN函數(shù)有助于減少OR條件的復(fù)合使用。

The?syntax?for?the?IN?function?is:

譯:IN函數(shù)的語法:

SELECT?columnsFROM?tablesWHERE?column1?in?(value1,?value2,?....?value_n);

This?SQL?statement?will?return?the?records?where?column1?is?value1,?value2...,?or?value_n.?The?IN?function?can?be?used?in?any?valid?SQL?statement?-?select,?insert,?update,?or?delete.

譯:該SQL語句將返回column1的值是value1,?value2...,或者value_n的記錄。IN函數(shù)可以用于任何合法的SQL語句中-select,?insert,?update,?or?delete。

Example?#1

The?following?is?an?SQL?statement?that?uses?the?IN?function:

譯:下面是一個(gè)使用IN函數(shù)的SQL語句

SELECT?*FROM?supplierWHERE?supplier_name?in?(?'IBM',?'Hewlett?Packard',?'Microsoft');

This?would?return?all?rows?where?the?supplier_name?is?either?IBM,?Hewlett?Packard,?or?Microsoft.?Because?the?*?is?used?in?the?select,?all?fields?from?the?supplier?table?would?appear?in?the?result?set.

譯:這將返回supplier_name為IBM,?Hewlett?Packard,或者M(jìn)icrosoft的所有記錄。因?yàn)樵赟ELECT中使用了*,supplier表中所有的字段都會(huì)顯示在結(jié)果集中。

It?is?equivalent?to?the?following?statement:

譯:與下面的SQL語句相同:

SELECT?*FROM?supplierWHERE?supplier_name?=?'IBM'OR?supplier_name?=?'Hewlett?Packard'OR?supplier_name?=?'Microsoft';

As?you?can?see,?using?the?IN?function?makes?the?statement?easier?to?read?and?more?efficient.

譯:正如你所看到的,使用IN函數(shù)使語句更容易讀并且有更高的執(zhí)行效率。

Example?#2

You?can?also?use?the?IN?function?with?numeric?values.

譯:你也可以同數(shù)字使用IN函數(shù)

SELECT?*FROM?ordersWHERE?order_id?in?(10000,?10001,?10003,?10005);

This?SQL?statement?would?return?all?orders?where?the?order_id?is?either?10000,?10001,?10003,?or?10005.

譯:將返回所有order_id是10000,?10001,?10003,或者10005的記錄

It?is?equivalent?to?the?following?statement:

譯:與下面的SQL語句相同:

SELECT?*FROM?ordersWHERE?order_id?=?10000OR?order_id?=?10001OR?order_id?=?10003OR?order_id?=?10005;

Example?#3?-?"NOT?IN"

The?IN?function?can?also?be?combined?with?the?NOT?operator.

譯:IN函數(shù)可以和NOT操作符連用

For?example,

SELECT?*FROM?supplierWHERE?supplier_name?not?in?(?'IBM',?'Hewlett?Packard',?'Microsoft');

This?would?return?all?rows?where?the?supplier_name?isneitherIBM,?Hewlett?Packard,?or?Microsoft.?Sometimes,?it?is?more?efficient?to?list?the?values?that?you?donotwant,?as?opposed?to?the?values?that?you?do?want.

譯:這將返回supplier_name不是IBM,?Hewlett?Packard,及Microsoft的所有記錄。有時(shí),與你想要的數(shù)據(jù)相反,這樣可以更有效的例出你不需要的值。

如果文章對(duì)你用,請(qǐng)支持萬事如意網(wǎng)址導(dǎo)航。

總結(jié)

以上是生活随笔為你收集整理的oracle中的in函数,Oracle中In函数的使用的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。