This might be simple if you know how, but I'm a bit stumped. 
Requirement:
Using pure ANSI-92 SQL (select, joins, sub queries, unions, that sort of thing), but no loops (while, for, repeat) and no cursors and no proprietary extension functions, expand two date parameters into individual dates. You can use any extra "lookup" join tables you might need.
E.g. given 20/12/2008 and 04/01/2009 return
20/12/2008
21/12/2008
22/12/2008
23/12/2008
24/12/2008
25/12/2008
26/12/2008
27/12/2008
28/12/2008
29/12/2008
30/12/2008
31/12/2008
01/01/2009
02/01/2009
03/01/2009
04/01/2009
I appreciate you might need a special table to join on containing monotonically increasing values to expand two parameters into multiple rows.
Maybe it's impossible (or impractical) without procedural loops or cursors?
If so, fine, I'll do it in code in the application rather than in the database.
TIA

Requirement:
Using pure ANSI-92 SQL (select, joins, sub queries, unions, that sort of thing), but no loops (while, for, repeat) and no cursors and no proprietary extension functions, expand two date parameters into individual dates. You can use any extra "lookup" join tables you might need.
E.g. given 20/12/2008 and 04/01/2009 return
20/12/2008
21/12/2008
22/12/2008
23/12/2008
24/12/2008
25/12/2008
26/12/2008
27/12/2008
28/12/2008
29/12/2008
30/12/2008
31/12/2008
01/01/2009
02/01/2009
03/01/2009
04/01/2009
I appreciate you might need a special table to join on containing monotonically increasing values to expand two parameters into multiple rows.
Maybe it's impossible (or impractical) without procedural loops or cursors?
If so, fine, I'll do it in code in the application rather than in the database.
TIA

Its the easiest way and anything else will just obstrufucate the code - or is that the aim?
Comment