Double sort

Discussion in 'PHP' started by kmap, May 19, 2008.

  1. #1
    Hi i m using Mysql 4.1

    I hv a table with 1000 records with name,id(unique),datetime

    I need a query to search 250 records order by date and then need those sorted alphabatically.
    I am using this at present
    select distinct name,url2 from search order by word limit 250

    but this send me first 250 records order by word

    I need lastest 250 records ordered by word

    Thanks

    Regards

    Alex
     
    kmap, May 19, 2008 IP
  2. onlinesoon

    onlinesoon Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Try the following code:

    
    SELECT *
    FROM `search` 
    ORDER BY datetime DESC , name ASC 
    LIMIT 250;
    
    Code (markup):
    I am not sure if this is exactly what you need but should give you an idea on how to run your query.
     
    onlinesoon, May 19, 2008 IP