You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 05_writing_complex_query/02_subqueries/readme.md
+13-8Lines changed: 13 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -23,13 +23,18 @@ In this syntax:
23
23
24
24
25
25
```sql
26
-
27
-
DELETEFROM orders
28
-
WHERE c_id = (
29
-
SELECT customer_id
30
-
FROM customers
31
-
WHERE first_name ="Delano"
32
-
);
26
+
DELETEFROM customers
27
+
WHERE
28
+
customer_id IN (SELECT
29
+
customer_id
30
+
FROM
31
+
(SELECT
32
+
customer_id
33
+
FROM
34
+
customers
35
+
36
+
WHERE
37
+
first_name ='junaid') AS temp_table);
33
38
```
34
39
35
40
@@ -95,4 +100,4 @@ When using subqueries in UPDATE statements, consider the following:
95
100
96
101
## Conclusion
97
102
98
-
Subqueries in the UPDATE statement offer a flexible approach to updating rows in a table based on conditions derived from other tables or complex logic. By understanding the syntax and considerations outlined in this documentation, you can effectively use subqueries in UPDATE statements to modify data in your MySQL database.
103
+
Subqueries in the UPDATE statement offer a flexible approach to updating rows in a table based on conditions derived from other tables or complex logic. By understanding the syntax and considerations outlined in this documentation, you can effectively use subqueries in UPDATE statements to modify data in your MySQL database.
0 commit comments