i'm web designer ... my first days in MySQl . so please help me guys ....
i have this sql sentences " thanks russell" ....
select a.dltitle, a.dldate, a.dlid, a.clientName,a.dlDetails, count(b.dlid) as numReplies,a.dlNew,b.replys ,replyDate
from topics a LEFT JOIN replys b On b.dlid = a.dlid WHERE a.dlState=1 group by a.dltitle, a.dldate, a.dlid, a.clientName,a.dlDetails order by a.dldate desc
it's gives me the first reply and first replyDate but i want select the last reply and date .....
select a.dltitle, a.dldate, a.dlid, a.clientName,a.dlDetails, count(b.dlid) as numReplies,a.dlNew,b.replys ,replyDate
from topics a LEFT JOIN replys b On b.dlid = a.dlid WHERE a.dlState=1 group by a.dltitle, a.dldate, a.dlid, a.clientName,a.dlDetails order by b.replys desc
i told u befor i have two table topics & replys .. ok
i want select all data from this two tables but i want just the last replys from the second table ....
select a.dltitle, a.dldate, a.dlid, a.clientName,a.dlDetails, count(b.dlid) as numReplies,a.dlNew,b.replys ,replyDate
from topics a LEFT JOIN replys b On b.dlid = a.dlid WHERE a.dlState=1 group by a.dltitle, a.dldate, a.dlid, a.clientName,a.dlDetails order by a.dldate desc
this sentence gives the first reply but i want only the last one ...
Bookmarks