Need some special output from select (order, decode, ...) [message #372065] |
Mon, 08 January 2001 15:23 |
X Men
Messages: 1 Registered: January 2001
|
Junior Member |
|
|
Hello,
I have a table
sql> select * from important;
+------+-------+
| prio | value |
+------+-------+
| 3 | x3 |
| 1 | x1 |
| 2 | x2 |
| 0 | x0 |
+------+-------+
4 rows in set (0.00 sec)
sql> select * from important order by prio;
+------+-------+
| prio | value |
+------+-------+
| 0 | x0 |
| 1 | x1 |
| 2 | x2 |
| 3 | x3 |
+------+-------+
4 rows in set (0.00 sec)
sql>
Since we define priority 0 as the lowest one,
I want the output as
+------+-------+
| prio | value |
+------+-------+
| 1 | x1 |
| 2 | x2 |
| 3 | x3 |
| 0 | x0 |
+------+-------+
Could some one help me about how to get this output?
Thanks
S.DONG
|
|
|
|
|