how to get top 3 records in sql


how to get top 3 records in sql  , or   how to get top 3 (RECENT ) record from mysql

query :

SELECT  * FROM TABL_NAME ORDER BY ID DESC LIMIT 0,3 



how to update multiple rows in mysql with one query with different values



UPDATE `tbname` SET `column_name` = CASE  `id`
WHEN '1' THEN '1'
WHEN '2' THEN '2'
WHEN '3' THEN '3'

END

Comments

Popular posts from this blog

Call PHP Function In JavaScript Using Ajax

List of Post Category Wise in wordpress