I would like to move a row to the bottom of the result set given a matched condition.
Database
+-------+------------+
|Symbol | Percentage |
|-------|------------|
|VG | 20 |
|-------|------------|
|CASH | 20 |
|-------|------------|
|GOOG | 60 |
+-------+------------+
ex:
SELECT * FROM TableName -SEND TO END OF RESULT SET- WHERE symbol = 'CASH'
result set:
GOOG
VG
CASH
To clarify my original question...
I ne开发者_JAVA技巧ed to write an exception for an ORDER BY
statement. To put the query into plain english - SELECT
an entire row, ordering by a timestamp, except if the symbol is "CASH"
To change the order of the rows in a result set you should use ORDER BY:
SELECT *
FROM TableName
ORDER BY symbol = 'CASH', timestamp
精彩评论