SELECT distinct state, machine
FROM states
order by machine, state
assuming your table is called 'states'