SitePoint Sponsor |
|
User Tag List
Results 1 to 2 of 2
-
Oct 22, 2009, 10:50 #1
- Join Date
- Sep 2008
- Posts
- 977
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
trying to get a result if another isn't returned.
Hi,
I am querying a table for a specific range of rows. If the query returns nothing, I want another range of rows to be selected. Either it returns >0 specific rows or it is to return a (default) specific 6.
Should I do this in my server side language or can I do it all in the query? I am wondering about case where...but wouldn't it check for a zero return for each row rather than for the whole query?
bazz
-
Oct 22, 2009, 10:54 #2
- Join Date
- Sep 2008
- Posts
- 977
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Just to clarify...
here is the current query
Code MySQL:
if there is nothing returned at all by the query, I need to output the default values. if just one record is returned, I need no more to be done.
bazz
Bookmarks