Structural question (1 Viewer)

torok

Registered User.
Local time
Yesterday, 23:39
Joined
Feb 3, 2002
Messages
68
Hi there,

I'm trying to figure out the best way to do this, and coul duse some input. I currently have a few data columns with primary keys KEYA KEYB KEYC, and a few other data columns with pk KEYA, KEYB, KEYC, KEYD, and a few OTHER columns with pk KEYA, KEYB.

Right now I have three tables (actually, there are even more like this, but I will keep it simple), one table for each set of PKs. This is a complete waste of space, and getting all the KEYA fields to match correctly for joins if I change the name of one of the keys is a pain.

I perform a successive sequence of calculation queries on these tables, creating temp tables along the way, and end up with a final result.

Is there a better way to organize this?
 

neileg

AWF VIP
Local time
Today, 07:39
Joined
Dec 4, 2002
Messages
5,975
I've read this several times and still don't understand what you are doing.

You seem to be suggesting that you have three tables, all of which have a multi field primary key. The fields that you use for these keys have the same names in your tables. OK?

If you have multi field PKs I don't understand how you can match using part of the key, unless you accept that this can be a many to many match. I also don't understand why you need to change the name of your fields.

In fact it's fair to say I don't understand much of this at all!

Can you have another go at explaining. It might help if you set out your table structures and some sample data, together with a better idea of what you want to achieve!
 

torok

Registered User.
Local time
Yesterday, 23:39
Joined
Feb 3, 2002
Messages
68
hmm.... my fault for being cryptic I suppose. You've got it right, except that I never match with part of a key. Just that I have 6 tables, and I do a whole lots of joins.

I think I finally answered my own question, actually. To make this a bit easier there will have to be a lot more joins, is all. Thanks for trying to sort through my bad explanation! Please ignore my question.

I promise if I have any more questions to ask, they will actually make sense.
 

Users who are viewing this thread

Top Bottom