查询的相关性 [英] Correlation of queries

查看:85
本文介绍了查询的相关性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

< pre></pre>


你好,

我想知道我们如何将查询与同一表相关联.

<pre></pre>


Hello,

I would like to know how do we correlate the queries with in the same table.
Please help me in having the knowledge.

推荐答案

您总是可以通过使用别名来做到这一点.
例如,请参见
You can always do this by using aliases.
As an example see
SELECT name
 FROM employee AS e1
 WHERE salary > (SELECT avg(salary)
    FROM employee
    WHERE department = e1.department)



我实际上是从获得的查询 [



I actually got the query from this[^] site, and you can read more about correlated subqueries on that web page.


这篇关于查询的相关性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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