Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2005
    Location
    Tinterweb
    Posts
    555

    Question MYSQL 'Order By' Query Help

    Don't know if this can be done!

    At the moment the data is displayed alphabetically (from the main_title) I would like to change this so it displays listings with the letter 'R' first then a,b,c,d,e etc or s,t,u,v,w if that's easier.

    This is the current query:
    SELECT * FROM helicopters WHERE display='1' ORDER BY main_title ASC;"
    Any help appreciated as always
    C program run. C program crash. C programmer quit.

  2. #2
    Join Date
    Oct 2002
    Location
    Canada
    Posts
    3,100
    Code:
    SELECT * FROM helicopters WHERE display='1' ORDER BY main_title LIKE 'r%' DESC,  main_title ASC;"
    This should work.

  3. #3
    Join Date
    Apr 2005
    Location
    Tinterweb
    Posts
    555
    Excellent, that works perfectly.
    Many thanks!
    C program run. C program crash. C programmer quit.

Similar Threads

  1. is this mysql query possible?
    By mikey1090 in forum Programming Discussion
    Replies: 6
    Last Post: 10-03-2006, 11:11 AM
  2. PHP: ORDER BY Query
    By MGHosted.net in forum Programming Discussion
    Replies: 2
    Last Post: 05-05-2005, 01:59 PM
  3. How to write order alphebitcally in sql query
    By lackeroom in forum Programming Discussion
    Replies: 5
    Last Post: 05-16-2004, 06:29 PM
  4. Help on mysql query
    By kapot in forum Programming Discussion
    Replies: 1
    Last Post: 11-09-2003, 05:07 AM
  5. MYSQL Query
    By WLHosting in forum Programming Discussion
    Replies: 1
    Last Post: 07-11-2003, 01:54 AM

Posting Permissions

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