dbms标识符无效_DBMS中的嵌套查询,相关的嵌套查询和集合比较运算符

dbms标识符无效

嵌套查询 (Nested Queries)

A query embedded in a query. This type of relation is termed as Nested Query and the Embedded Query is termed as a subquery.

查询中嵌入的查询。 这种类型的关系称为嵌套查询,而嵌入式查询称为子查询。

For example: To find the names of employee who are department Id 103.

例如:查找部门ID为103的雇员的姓名。

For example:

例如:

SELECT E.ename
FROM Employee E
WHERE E.id IN (SELECTD.id FROM Department D WHERE D.id = 103)

相关嵌套查询 (Correlated Nested Queries)

These types of queries are nested queries which are independent or depend only on the same row of an outer query being an embedded query.

这些类型的查询是嵌套查询,它们独立或仅取决于外部查询的同一行(即嵌入式查询)。

For example: To find the names of employee who are department Id 103.

例如:查找部门ID为103的雇员的姓名。

SELECT E.ename
FROM Employee E
WHERE EXISTS (SELECT *x FROM Department D WHERE D.id = 103 AND D.id = E.id)

集合比较运算符 (Set Comparison Operators)

There are different types of set comparison operators like EXISTS, IN and UNIQUE. SQL also supports op ANY and op ALL, where op means arithmetic comparison operators such as <, <=, =, <>, >=, >. SOME are also one of the set comparison operators but it is similar to ANY.

集合比较运算符有多种类型,例如EXISTS,IN和UNIQUE。 SQL还支持op ANY和op ALL,其中op表示算术比较运算符,例如< , <= , = , <> , > = , > 。 SOME也是集合比较运算符之一,但它与ANY相似。

For example: Find Employees whose salary is greater than an employee named Shivam.

例如:查找薪水高于名为Shivam的雇员的雇员。

SELECT E.id
FROM Employee E
WHERE E.salary>ANY (SELECTE2.salary FROM Employee E2 WHERE E2.ename = 'Shivam')


翻译自: https://www.includehelp.com/dbms/nested-queries-correlated-nested-queries-and-set-comparison-operators-in-dbms.aspx

dbms标识符无效

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值