I've a flights table that consists of few columns but somebody seem to have ran a migration twice that resulted in creation of same data twice.
Anyway, the flight should only have only data from the following condition: The flight_number and the date. Basically the table is looking like this at the moment:
flight_number | date |
---|---|
123 | 2021-09-16 |
123 | 2021-09-16 |
123 | 2021-09-17 |
124 | 2021-09-18 |
124 | 2021-09-18 |
Result I want:
flight_number | date |
---|---|
123 | 2021-09-16 |
123 | 2021-09-17 |
124 | 2021-09-18 |
Basically, keep only one and remove duplicated (if the flight_number is same of the same date).
I'm looking for a DELETE SQL query but couldn't find the one like I am looking for. What is the query that can help me achieve it? Thanks!
EDIT: Yes, all the data has a column id
that is unique even if the data is same.