There was an error while loading. Please reload this page.
1 parent 3d884c3 commit 037e9c3Copy full SHA for 037e9c3
multi_row_sub_query_using_exist_operator.sql
@@ -0,0 +1,28 @@
1
+use techysanoj;
2
+
3
+show tables;
4
5
+select* from ecommerce_sales_large limit 10;
6
+select max(quantity) from ecommerce_sales_large;
7
8
+-- sub query
9
+select * from ecommerce_sales_large where quantity > 3;
10
11
12
+select *
13
+from ecommerce_sales_large
14
+where exists
15
+(select *
16
17
+where quantity > 3);
18
19
+-- exist means if the inner query returns any no of row (means simply run)
20
+-- then the outer query will work else it will not
21
22
23
24
25
26
27
28
+where quantity > 5); -- now this will not be having any output because inner query return 0 rows.
0 commit comments