Reputation: 771
I run this query(it's a test db,so don't laugh for name of columns)
mysql> select concat (SPACE(temperature),city) as city,temperature from tableexample order by temperature desc;
+------------------------------------------+------------+
| city | temperature|
+------------------------------------------+------------+
| Cape Town | 32 |
| Paris | 22 |
| Rome | 15 |
| New York | 12 |
| London | 11 |
+------------------------------------------+------------+
5 rows in set (0,00 sec)
If I remove SPACE,the output put the number before City
I want an output like this,how to do?
+-------------------------+
| city | temperature |
+-------------------------+
|Cape Town | 32 |
|Paris | 22 |
|Rome | 15 |
|New York | 12 |
|London | 11 |
+-------------------------+
Upvotes: 0
Views: 48
Reputation: 6361
You can just type:
select city,temperature from tableexample order by temperature desc;
Upvotes: 1