Update technical readme (#7248)

Fix a wrong query, reported by @naisila
pull/7247/head^2
Önder Kalacı 2023-10-06 13:37:37 +03:00 committed by GitHub
parent 0dca65c84d
commit 7d6c401dd3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 8 deletions

View File

@ -447,14 +447,8 @@ WHERE orders_table.user_id = distinct_user_id;
#### Subquery in Target List
```sql
-- Sum of max price per product category, filtered by a subquery in the target list
SELECT
(SELECT MAX(price) FROM products_table p WHERE p.category = o.category),
COUNT(DISTINCT o.product_id)
FROM orders_table o, users_table u
WHERE o.user_id = u.user_id AND u.user_id IN
(SELECT user_id FROM special_users_table)
GROUP BY o.category;
-- retrieves the most recent order date for each user
SELECT (SELECT MAX(order_date) FROM orders_table o WHERE o.user_id = u.user_id) FROM users_table u;
```
#### Subquery in WHERE Clause