I have table
named Student
. It have primary key student_id
which is auto increment
and not null
.
Now Student
contains around 5000 records.
After passed out from university, we need to delete specific student record from Student
and related child table as well.
It is working good.
I need to get those numbers who are not in student_id
range.
For ex.
I have 5000 records. So assume range is 1-5000. In Student
table, there may be data with primary key :
student_id
:
1
2
4
5
6
7
9
12
15
etc…
So I want deleted ids, like : 3, 8, 10, 11, 13, 14, etc… And need this result in some text file.
Finally I have 2 questions :
- Need query to get those deleted ids
- Can I export result in some file after fired query ?
Best Answer
fiddle