I have a table with many columns. The table includes an address_ID column and a type_ID column.
There are some duplicates in the address_ID column, which become apparent when I sort on that column.
I want to create a new table which has no duplicate address_ID rows.
The order of picking which row to select, when there are multiple rows with the same address_ID, goes like this:
1. Select row with type_ID 2869
2. If none, then select row with type_ID 4162
3. If none, select row with type_ID 2868
4. If none, select row with type_ID 4919
2. If none, give up and just select any row
What SELECT statement would give me this result?