I have a the following table in Mysql:
id | Name | Abbreviation |
---+-----------------------+---------------+
1 | aaaa | a |
3 | bbbb | NULL |
2 | cccc | c |
4 | dddd | d |
8 | eeee | NULL |
---+-----------------------+---------------+
I'd like a query to retu the following. If the abbreviation is specified, then retu the abbreviation, if no abbreviation, then retu name, but abbreviation and name should be ordered alphabetically, so something like this
id | Result |
---+----------+
1 | a |
3 | bbbb |
2 | c |
...
How can I do this?
