Skip to content

Commit e550e60

Browse files
Update readme.md
1 parent 7a3156e commit e550e60

File tree

1 file changed

+13
-8
lines changed
  • 05_writing_complex_query/02_subqueries

1 file changed

+13
-8
lines changed

05_writing_complex_query/02_subqueries/readme.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,18 @@ In this syntax:
2323

2424

2525
```sql
26-
27-
DELETE FROM orders
28-
WHERE c_id = (
29-
SELECT customer_id
30-
FROM customers
31-
WHERE first_name = "Delano"
32-
);
26+
DELETE FROM 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);
3338
```
3439

3540

@@ -95,4 +100,4 @@ When using subqueries in UPDATE statements, consider the following:
95100

96101
## Conclusion
97102

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

Comments
 (0)