Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Hi. I notice SQL Server 7.0 has a subset function which should allow me to generate all possible combinations from a master set. However, when I attempt to test this function, it bombs. Anyone have an example, similar to what I described above, that works on v. 7.0?thx.
Page47
Master Smack Fu Yak Hacker
2878 Posts
Posted - 2003-11-20 : 10:43:20
SUBSET is an MDX function, not a T-SQL function.Jay White{0}
jsmith8858
Dr. Cross Join
7423 Posts
Posted - 2003-11-20 : 10:50:13
Cross join ?- Jeff
Arnold Fribble
Yak-finder General
1961 Posts
Posted - 2003-11-20 : 14:42:20
This sort of thing:
DECLARE @setsize intSET @setsize = 9SELECT S.n, B.nFROM Numbers AS SINNER JOIN Numbers AS B ON S.n & POWER(2, B.n) > 0WHERE S.n BETWEEN 0 AND POWER(2, @setsize)-1 AND B.n BETWEEN 0 AND @setsize-1