www.webdeveloper.com
Results 1 to 11 of 11

Thread: help Query modification ...... last entry

  1. #1
    Join Date
    Aug 2006
    Posts
    21

    help Query modification ...... last entry

    hi friends .....

    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 .....

    so please help me


    my all regards

  2. #2
    Join Date
    May 2006
    Posts
    141
    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 think thsi query list the last replay

  3. #3
    Join Date
    Aug 2006
    Posts
    21
    thanks for your effort "vssp"...

    but it's gives the first reply too....

  4. #4
    Join Date
    Aug 2006
    Posts
    21
    please ..... help ..... any ideas ....???

  5. #5
    Join Date
    May 2006
    Posts
    141

    Thumbs up

    sorry Can you please send me the query rest and what you want this query so i able easy to understand your problem an dreplay immediatly .

    Any other users also send any idea.

    Thanks

  6. #6
    Join Date
    Aug 2006
    Posts
    21
    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 ...

    thanks again

    all my regards

  7. #7
    Join Date
    Feb 2003
    Posts
    2,745
    what db are u using?

  8. #8
    Join Date
    Aug 2006
    Posts
    21

    please help....... i need it

    thanks all ..... i really need select the last reply ....

    by the way i'm using MySQL.....

    please help guys

  9. #9
    Join Date
    Jun 2003
    Location
    Indiana, USA
    Posts
    1,138
    Change your order by to a.dldate asc

  10. #10
    Join Date
    Aug 2006
    Posts
    21
    i really need this query ...... please help me guys

  11. #11
    Join Date
    Aug 2006
    Posts
    21
    i still need it ...... please help

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles