官术网_书友最值得收藏!

Subquery

A Select statement under the select statement is called a subquery. This sub statement can be used to select the column or in conditional cases. A subquery can also be nested within another query statement like INSERT, UPDATE, or DELETE.

The following query returns a set of users who are located in Ahmedabad using a subquery:

SELECT firstName, lastName FROM users 
WHERE city IN
(SELECT city FROM cities WHERE city = 'Ahmedabad');
主站蜘蛛池模板: 永济市| 邯郸县| 乐亭县| 拉孜县| 鄂托克旗| 专栏| 酉阳| 西城区| 洛南县| 阆中市| 布尔津县| 澜沧| 辽宁省| 府谷县| 来凤县| 德州市| 南召县| 丹巴县| 锡林浩特市| 甘南县| 镇江市| 安多县| 安乡县| 大宁县| 南汇区| 平南县| 东港市| 东兰县| 西林县| 永城市| 浦城县| 房产| 梁河县| 马龙县| 衡阳县| 阿尔山市| 南岸区| 海城市| 将乐县| 乳山市| 十堰市|