| Author |
Topic |
|
kahwinlee
Starting Member
2 Posts |
Posted - 2006-05-24 : 03:03:55
|
i wish to generate a sql which is not related to any table and can show the following result with two parameter 1997 and 2000:--------| year |--------| 1997 || 1998 || 1999 || 2000 |-------- My Spring Without PocKet |
|
|
chiragkhabaria
Master Smack Fu Yak Hacker
1907 Posts |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-05-24 : 03:08:15
|
Why do you need this?Declare @first int, @last intSelect @first=1997, @last=2000Declare @years table(years int)While @first<=@lastBegin Insert into @years Select @first Set @first=@first+1 EndSelect years from @years MadhivananFailing to plan is Planning to fail |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
|
|
chiragkhabaria
Master Smack Fu Yak Hacker
1907 Posts |
Posted - 2006-05-24 : 03:15:34
|
If Debugging is the process of removing Bugs then i Guess programming should be process of Adding them. |
 |
|
|
kahwinlee
Starting Member
2 Posts |
Posted - 2006-05-24 : 03:17:18
|
| Due to the limitation of i-Net crystal clear report, I need to group the data by year and the searching criteria is two ?year, so I trying to generate a sub-report based on the year parameter...really hard to say, but it seems like so stupid ... I'm really stuck at here 2 days already...by the way, I'm using MySQL Server 5.0 and facing problem in both sql u guys are suggested, for this sql :Select * From F_TABLE_NUMBER_RANGE(1997,2001) <= it seems like only available for SQL Server...My Spring Without PocKet |
 |
|
|
chiragkhabaria
Master Smack Fu Yak Hacker
1907 Posts |
Posted - 2006-05-24 : 03:18:57
|
| oh!!This is SQL Server Forum..If Debugging is the process of removing Bugs then i Guess programming should be process of Adding them. |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2006-05-24 : 03:23:54
|
"I'm using MySQL Server 5.0"Try dbforums.com KH |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-05-24 : 04:10:11
|
| or try at www.MYSQL.comMadhivananFailing to plan is Planning to fail |
 |
|
|
|