Thursday, April 30, 2009

Complicated Queries in MySQL

SELECT match_id AS m1
FROM `match_info`
ORDER BY match_id =18 DESC

in this query "match_id=18" is given in the ORDER BY because when we need to fetch the "match_id=18" as the first record, then we can write the query like this and rest of the records in the table "match_info" are fetched as 2nd , 3rd and etc records ..

more info..

No comments: