I'm trying to figure out how I can sort records alphabetically by almost
"blending" two fields.
SELECT city, county
FROM fullist
WHERE type = 'city' or type = 'county'
ORDER BY ???;
It should output like this :
----------------------------
| city | county | type |
----------------------------
| A | x | city |
| x | B | county |
| C | x | city |
| x | D | county |
----------------------------
"Type" indicates which of the fields should be used for the sort. I'm thinking
that a JOIN might be necessary, but can't seem to get my head around how to do
it.
Any and all advice will be greatly appreciated !
"blending" two fields.
SELECT city, county
FROM fullist
WHERE type = 'city' or type = 'county'
ORDER BY ???;
It should output like this :
----------------------------
| city | county | type |
----------------------------
| A | x | city |
| x | B | county |
| C | x | city |
| x | D | county |
----------------------------
"Type" indicates which of the fields should be used for the sort. I'm thinking
that a JOIN might be necessary, but can't seem to get my head around how to do
it.
Any and all advice will be greatly appreciated !
Comment