Consider a table with the following schema:
id, location, starred
There are many records with the same location:
id | location | starred
-----------------------
1 rome yes
2 rome no
3 rome no
4 milan yes
5 milan no
6 bozen no
I want to have at most one record per location. And given the choice between a starred record and a not starred record I want the starred. So what sql will produce this table:
id | location | starred
-----------------------
1 rome yes
4 milan yes
6 bozen no
I suspect this could be done with some virtual tables or ªviews'.
DELETE FROM table
GROUP BY location,
If [started] can only be yes, or no, then this should work: