I got a table with Cities and States it looks something like:
cityid |city |stateid |state
--------------------------------------
0566 |abriaqui|05 |antioquia
0599 |alejand |05 |antioquia
0511 |another |05 |antioquia
0782 |dummy1 |09 |caldas
0783 |dummy2 |09 |caldas
0785 |dummy3 |09 |caldas
0788 |dummy4 |03 |Narino
0767 |dummy5 |03 |Narino
0734 |dummy6 |03 |Narino
As you can see I have Cities with uniques IDs, and the state they belong to is just to the right, with the state id and the state name. I would like to make a query that returns something similar to DINSTINCT(state):
STATE
--------------------
antioquia
caldas
narino
But I need the stateid too. How can I reach this?