It is a subquery that appears in the From clause of the Select statement. This subquery is enclosed in parenthesis and may be given an alias name. The columns selected in the subquery can be referenced in the parent query. The syntax for an inline view is,. We can simplify the above SQL using the inline view construct as follows:. Read Also Insert into select. An inline query is sql code hardcoded inside some other platform such as C e.
Improve this answer. Janine Rawnsley Janine Rawnsley 1, 2 2 gold badges 9 9 silver badges 18 18 bronze badges. Hope this help. QMaster QMaster 3, 2 2 gold badges 37 37 silver badges 54 54 bronze badges. Mirko Mirko 4, 1 1 gold badge 20 20 silver badges 19 19 bronze badges.
Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. Even though they look similar, they work differently. The first difference is that inline views can contain multiple columns, while subqueries in the Oracle meaning should return only one.
The reason is simple — an inline view works like a table and tables can contain more than one column. Subqueries, on the other hand, generally work as a single value. The second one is correlation. In non-inline views, you can use a value for the outer main query. That way, your subquery can return a different value for different rows. This concept is very powerful and can save you time when you write complicated queries. If you feel like you need more info on the topic and the different types of subselects including inline views , check out the article What Are the Different Types of SQL Subqueries?
Everything comes down to your knowledge and usage of this powerful SQL technique. Of course, when communicating with others, you should do your best to avoid miscommunication.
Back to articles list Articles Cookbook. Subquery vs.
0コメント