Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder
    Join Date
    Nov 2002
    Posts
    122
    Thanks
    1
    Thanked 0 Times in 0 Posts

    SQL Query order by question

    I have a table that has 1-365 (1 entry for every day of the year) listed, I was just asked to add the word AIRED nad NOT AIRED to this table. I need the 2 above text to appear first, then the numbers in numerical order, any idea how i can do this..ie.,

    Aired
    Not Aired
    1
    2
    3
    4
    5
    etc..

    My current query is
    Code:
    sEpisode="SELECT EpisodeID, Episode FROM Episode ORDER BY EpisodeID ASC "

  • #2
    Senior Coder angst's Avatar
    Join Date
    Apr 2004
    Location
    Toronto, Ontario
    Posts
    2,114
    Thanks
    15
    Thanked 122 Times in 122 Posts
    if i understand you correctly, this is just an ORDER question ( should really been in the sql forum ),

    try:
    PHP Code:
    ORDER BY AIRED ASCNOT_AIRED ASCEpisodeID ASC 
    notice the order of operation.

  • #3
    Regular Coder
    Join Date
    Nov 2002
    Posts
    122
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Thanx, i'll try that...

    As for the forum, there's only a MySql Forum, not ms SQL ?

  • #4
    Senior Coder angst's Avatar
    Join Date
    Apr 2004
    Location
    Toronto, Ontario
    Posts
    2,114
    Thanks
    15
    Thanked 122 Times in 122 Posts

  • #5
    Regular Coder
    Join Date
    Nov 2002
    Posts
    122
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Will do in future, thx


  •  

    Posting Permissions

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