Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Query Join Problem

Author  Topic 

angjbs
Starting Member

2 Posts

Posted - 2006-02-17 : 09:33:36
I have this:
T-1 T-2 T-3
pkID pkID pkID
f1 f1 f1
f2 f2 f2
t1FK t1FK


t-1 Data
1 Joe admin

t-2 Data fkid
1 Grape 200 1

t-3 Data fkid
1 1 0 1
2 0 1 1

Ok t-1 join t-2 and t-3

When I make the query I got:

1 Joe admin Grape 200 1 0
1 Joe admin Grape 200 0 1


The problem is if I make a sum for a field 5 in the query I got 400 what is bad because I have 200.

I want This result in a group query:
1 Joe Admin Grape 200 1 1

RickD
Slow But Sure Yak Herding Master

3608 Posts

Posted - 2006-02-17 : 09:56:00
You want the sum on your t-3 data field then..
Go to Top of Page

angjbs
Starting Member

2 Posts

Posted - 2006-02-17 : 17:25:54
yes I want the sum of f2 and f3 in t-3
Go to Top of Page
   

- Advertisement -