कैसा कुछ ऐसा है
SELECT DISTINCT messages.fromid,
messages.readed,
messages.fromid,
messages.toid ,
members.id AS pid
FROM messages
INNER JOIN members
ON members.id = messages.fromid
WHERE messages.toid = ".$mid."
AND members.status = 7
AND messages.kreaded !='1'
AND messages.subject != 'readed'
ORDER BY messages.fromid ASC,
messages.id DESC
या
SELECT DISTINCT messages.fromid,
messages.readed,
messages.fromid,
messages.toid ,
members.id AS pid
FROM messages
INNER JOIN members
ON members.id = messages.fromid
WHERE messages.toid = ".$mid."
AND members.status = 7
AND messages.kreaded !='1'
AND messages.subject != 'readed'
ORDER BY messages.fromid ASC,
messages.sendtime DESC
messages.fromid ASC . में एएससी विशुद्ध रूप से वाक्य-विन्यास है, जैसा कि ASC/DESC निर्दिष्ट किए बिना ORDER BY ASC मान लेता है।
SELECT *
FROM TABLE
ORDER BY COL ASC
के समान है
SELECT *
FROM TABLE
ORDER BY COL