SitePoint Sponsor |
|
User Tag List
Results 1 to 5 of 5
Thread: selecting
-
Jul 10, 2001, 11:38 #1
- Join Date
- Apr 2001
- Location
- BC, Canada
- Posts
- 630
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
selecting
I have a database filled with articles...
there are two types
current
past
they are indicate in a collum named 'type'
Using a select statement in mysql, how could I retrive all the articles in alphabetical order, but have current first...
so it would be current a-z then past a-z
I want to be able to do this in one satement
thanx
-
Jul 10, 2001, 12:01 #2
- Join Date
- Jun 2001
- Location
- NY, New York
- Posts
- 77
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
PHP Code:SELECT article_text FROM article_table ORDER BY type, article_text
Hope that helps.
-
Jul 10, 2001, 12:18 #3
- Join Date
- Jan 2001
- Location
- California
- Posts
- 342
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
PHP Code:
"SELECT title FROM articles_table ORDER BY age, title ASC"
That statement will sort the table alphabetically by age (your current/pass column ) first, and then by the title column.
Thus giving you a list with the titles that are in alphabetical order and start over at current/past differences.
I believe this will work, but not sure, so please let me know if it does.
Good luck!-Jeff Minard | jrm.cc - Battlefield 2 Stats
-
Jul 10, 2001, 13:17 #4
- Join Date
- Apr 2001
- Location
- BC, Canada
- Posts
- 630
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
nope..that dosnt seem to work
-
Jul 10, 2001, 15:08 #5
- Join Date
- Jan 2001
- Location
- California
- Posts
- 342
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally posted by slighltywhacked
nope..that dosnt seem to work-Jeff Minard | jrm.cc - Battlefield 2 Stats
Bookmarks