8 table need to design queries for all possible combinations...

Whatever you are doing you are doing it in a silly way, your problem isn't the 256 queries it's that the way you store your information is rubbish. Change it.
 
HARDY - TRY THIS

assuming your membership tables have the same member number, then do a sinlge query for each table

ie
select dataitems from tbl_1 where user = targetid
select dataitems from tbl_2 where user = targetid
select dataitems from tbl_3 where user = targetid

etc

then do a union query with the sql so you get

select dataitems from tbl_1 where user = targetid
union
select dataitems from tbl_2 where user = targetid
union
select dataitems from tbl_3 where user = targetid

etc

you will now have a single table with all the inof in

the only issue is that the column types of all the union-ed queries have to match
 
chergh - Thanks, but like I said this is not a dB, its using a database (the only way I could think how to) reaching a required result; I know how to normalise data etc - however this is one occasion were, well as you can all tell there seems to be no easy way of reaching a swift conclusion.


gemma-the-husky - thanks kind of what I've done in a flipped way, I've used union to pull all the files together - doing this by id would take ages as there are a couple of thousand people in the file.

Thanks
H
 
If you had merged these into a single table and included a table-ID in the resultant record, you could have sorted on person ID first, table ID second, and not had to do ANY combinatorial stuff.
 

Users who are viewing this thread

Back
Top Bottom