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.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Combinations

Author  Topic 

mahimam_2004
Starting Member

40 Posts

Posted - 2007-01-24 : 11:17:03
Hi,
I have the table:
exexposureRoute: with columns
caseId, exRouteID
200 70
300 71
200 72
200 73
.. ..

Route table:
exRoteID name
70 a
71 b
72 c
73 d
.. ..
In my result set i want like this:
Route CaseCount
a 78
b 89
c 90
d 345
a/b 9
a/c 8
a/d 9
a/b/c 2
Otherroute comb 98
in the above a/b means i want the casecount for which cases both a and b exists.
For one case there mey be possibilty of more than one route.

How to write the query to get those routes combinations case counts.
Thnaks in advance

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-01-24 : 11:23:47
Please tell us how a/b/c can be 2...


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

mahimam_2004
Starting Member

40 Posts

Posted - 2007-01-24 : 11:43:46
Hi,
That means for one case the routes are 1,2,3 existed.
for a/b/c the casecount display all the caseids count for which a,b,c are possible.
Thanks in advance
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-01-24 : 12:24:08
How many combinations are possible?


Peter Larsson
Helsingborg, Sweden
Go to Top of Page
   

- Advertisement -