Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> SQL QUERIES ... EXPERT HINTS NEEDED !
SQL QUERIES ... EXPERT HINTS NEEDED ! The problem is the following:
Consider the 3 tables TOWNS, DEMOG, POST:
DD (District code) CC (County code) TT (Town code)
TT (Town code)
POP (Town population)
PO_ID (Post Office uinque ID)
DD (District code) CC (County code) TT (Town code)
---------------------
Consider also the existing relations:
TOWNS (TT) --------- ONE-TO-ONE-----------> (TT) DEMOG TOWNS (DD,CC,TT) --------- ONE-TO-MANY-----------> (DD,CC,TT) POST The hierachy for DD,CC,TT is the following: One District --> Many Counties, One County --> Many Towns
I have tried several queries and I usually get the right count of Post Offices but I get huge Sums of population. It seems that it keeps adding up the population of a same town, for every ocurrence of a Post Office. How can I solve this redundancy problem ?
Thanks in advance.
Miguel Received on Tue Jul 08 1997 - 00:00:00 CDT
![]() |
![]() |