I have a sql table which looks like :
srno | passportnumber|flightnumber
Null | ABC123 |AI-2000
Null | ab3333 |AI-2011
Null | ab565235 |AI-2562
Null | ABC123 |AI-2025
Null | ABC123 |AI-5623
Null | XYZ12334 |AI-5625
I need a query to sort them by passportnumber so that repetitive passportnumber rpws are next to eachother and then i want to update the table to insert the serialnumber.
the result should be something like this :
1 | ABC123 |AI-2000
2 | ABC123 |AI-2025
3 | ABC123 |AI-5623
4 | ab3333 |AI-2011
5 | ab565235 |AI-2562
6 | XYZ12334 |AI-5625
Try this:
Live Demo