DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   MS SQL (http://www.daniweb.com/forums/forum127.html)
-   -   Need help to build a query (http://www.daniweb.com/forums/thread96891.html)

veggen Nov 15th, 2007 1:26 pm
Need help to build a query
 
I'm having trouble with the following scenario:
drivers may have any of the 16 types of certificates, tasks may require any of the 16 types as well. What I need to do is build a query that will selectd all the tasks a certain driver can perform.
Example:
driver has these certificates: A,B,C,C1,C1E
so he can perform tasks that require any of these certs or any combination of certs (ie. only A, only B, both A and B, A and C1E, A,B and C1 etc).

I already have come up with a solution (which makes every possible combination), but it is very complicated and works well only with a smaller number of certificates, but with 16 (as it is the case) it requires more memory then it is available...

Any idea how to make a more efficient query?

Thanks for the time :)

iamthwee Nov 15th, 2007 4:10 pm
Re: Need help to build a query
 
You would have to go for a 'dynamic solution' where you are not guaranteed to hit the optimal solution.

A good example would be Dijkstra's shortest path finding algo.

veggen Nov 16th, 2007 6:45 am
Re: Need help to build a query
 
Thanks, I'll look into it.


All times are GMT -4. The time now is 12:18 pm.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC