![]() |
Advanced Query
I currently have a system which employs cascading user levels there is first the Group User levels and their associated rules than there are the User Specific "rules" with the ladder over riding the former.
Currently I'm employing 2 queries to check for the User and exit out or the Group, how ever I was wondering if it could be done in one. Currently employed queries sql Code:
sql Code:
It differs by the last three lines. I might need to rethink my database design... Perchance could anyone tell me what I could do? I was thinking of using the UNION statement but then there are possibilities of a group and a user having the same id. |
I think you need to change the design of your database. Take a step back and ask yourself.
What tables can I merge and what tables can I get rid of? If you database is no longer 100% 3nf who cares. You should not have to do 2 joins in a single query. You really want to avoid as many joins as possible as they will slow down your querys a greay deal once the database gets some size to it. |
| All times are GMT. The time now is 06:46 AM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0