Ordering by specific field value first| Mysql order by specific values

Default Order by :
SELECT * FROM accountsreportdb.sourcefinal 
ORDER BY `Invoice No` desc;


Example:

Priority Sorting(MySQL FIELD function Used).

If you only care that "1055" is first and the other values don't matter:
SELECT *  FROM  accountsreportdb.sourcefinal 
ORDER BY FIELD(`Invoice No`,'1055') desc;

Example:

Post a Comment

0 Comments