ITM 500 Lecture Notes - Lecture 9: Result Set, Aggregate Function, Virtual Method Table
Document Summary
Chapter 8 section 2: subqueries and correlated. It"s often necessary to process data based on other processed data. I. e. suppose that you want to generate a list of vendor who don"t provide products). You could do so by writing the following query. Select v_code, v_name from vendor where v_code not in (select v_code. In that case, you used a subquery to generate the required info, which could then be used as input for the original query. The basic characteristics for subqueries are the following: It"s a query (select statement) inside another query. The first query in the sql statement is known as the outer query. The query inside the sql statement is known as the inner query. The output of an inner query is used as the input for the outer query. The entire sql statement is sometimes referred to as a nested query. One single value (one column and one row).