SitePoint Sponsor |
|
User Tag List
Results 1 to 3 of 3
Thread: ORDER BY Question
-
Dec 23, 2004, 17:24 #1
- Join Date
- Aug 2004
- Location
- Utah, USA
- Posts
- 110
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
ORDER BY Question
Hi,
I'm not sure if this is doable or not but ...
I have a table with two timestamps: datetime_published and datetime_modified
I would like to build a query that would select all the records and then order them by either the datetime_published or the datetime_modified (whichever was most current).
Thanks,
Kevin
-
Dec 23, 2004, 18:46 #2
- Join Date
- Jul 2002
- Location
- Toronto, Canada
- Posts
- 39,347
- Mentioned
- 63 Post(s)
- Tagged
- 3 Thread(s)
very doable
ORDER BY greatest(datetime_published,datetime_modified)
-
Dec 29, 2004, 16:18 #3
- Join Date
- Aug 2004
- Location
- Utah, USA
- Posts
- 110
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Perfect!
Thanks r937!
Kevin
Bookmarks