Skip to content

Commit 1751916

Browse files
authored
Create 1613-find-the-missing-ids.sql
1 parent 8573ae9 commit 1751916

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

1613-find-the-missing-ids.sql

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Write your MySQL query statement below
2+
WITH RECURSIVE id_seq AS (
3+
SELECT 1 as continued_id
4+
UNION
5+
SELECT continued_id + 1
6+
FROM id_seq
7+
WHERE continued_id < (SELECT MAX(customer_id) FROM Customers)
8+
)
9+
10+
SELECT continued_id AS ids
11+
FROM id_seq
12+
WHERE continued_id NOT IN (SELECT customer_id FROM Customers);

0 commit comments

Comments
 (0)