vendredi 20 février 2015

How to combine 2 columns into a new one in sqlite

I have a table with 3 columns and I have to put the values from 2 columns into one in descending order.



+---+---+---+
| A | B | C |
+---+---+---+
| z | 1 | 2 |
| f | 5 | 7 |
| s | 9 | 5 |
+---+---+---+

Using this example the output would be putting the values from column B and C into one like this:



+---+----+
| A | B |
+---+----+
| s | 9 |
| f | 7 |
| f | 5 |
| s | 5 |
| z | 2 |
| z | 1 |
+---+----+

How can I do this? Thanks.


Aucun commentaire:

Enregistrer un commentaire