Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

complex Cross tab Query problem

Status
Not open for further replies.

colby

Technical User
Jul 6, 2000
11
GB
I have a table which contains the following data :-
loc_id id val
730 450 1
730 250 2
730 350 2
730 251 3
730 351 4
730 451 3
I need to show the data as
for each loc_id dependant for certain id's
The value contains the group and for others the
val is to be added together e.g.
loc_id Val1 Val2
730 1 3 = 450 = 451
730 2 7 = 250&350 are the same so = 251+351

val1 = the values within id's 450,250,350 grouped by the values
val2 = the values within id's 451,251,351 added together
dependant upon the grouping of the values within val1

If anyone could help I would eternally be in awe of their
SQL prowess.
Thanks in advance for any help with this problem.
Dave.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top