Duplication Problem with sql function in a query

arnodys

Registered User.
Local time
Tomorrow, 08:02
Joined
Apr 24, 2006
Messages
20
Hi all,

Please note the following table:

ShopID | Desc | NumberItem | Price each | Total | ShopGrandTotal
01 | Drills | 2 | $200 | $400 | $425
01 | Nails | 5 | $5 | $25 | $425
02 | Hammer | 3 | $20 | $60 | $160
02 | Paint | 10 | $10 | $100 | $160

I try to do this in one query but resulted in heaps of duplicate values. Can anyone help?

Thanks
 
more clarificaiton required...

in the table the last field is not required as you can calculate it in a simple query... how you getting duplicates??
 
Why do you have duplicate IDs? These surely should be unique. Also why are you trying to add up the total of Drill with nails and Hammers with Paint. I think you need to normalise your database and as "mpb.vu2" says do not store calculated figures.
 

Users who are viewing this thread

Back
Top Bottom