Getting rows containing max date

Discussion in 'PHP' started by KingCobra, May 26, 2009.

  1. #1
    I have a table named 'news' with following data


    news_id news_date news_details
    ------- ----------- -------------
    111111 2009-03-30 News details here
    333333 2009-05-14 details eb ert berjtber
    222222 2009-04-30 News 222222 title here
    444444 2009-05-14 detaaaaisidj sdsd kse


    what will be the mySQL query to produce rows containg max date?
    The output will be -


    333333 2009-05-14 details eb ert berjtber
    444444 2009-05-14 detaaaaisidj sdsd kse
     
    KingCobra, May 26, 2009 IP
  2. Bohra

    Bohra Prominent Member

    Messages:
    12,573
    Likes Received:
    537
    Best Answers:
    0
    Trophy Points:
    310
    #2
    Bohra, May 26, 2009 IP
  3. KingCobra

    KingCobra Well-Known Member

    Messages:
    289
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    103
    #3
    Data type for 'news_date' filed is 'date'
     
    KingCobra, May 26, 2009 IP
  4. KingCobra

    KingCobra Well-Known Member

    Messages:
    289
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    103
    #4
    Solved By Me
     
    KingCobra, May 26, 2009 IP
  5. Bohra

    Bohra Prominent Member

    Messages:
    12,573
    Likes Received:
    537
    Best Answers:
    0
    Trophy Points:
    310
    #5
    Good to know u solved it..its best to go to phpmyadmin and try to organize it there from the place where u can browse the table they even tell u the query neways good u got it
     
    Bohra, May 26, 2009 IP