hi,i have following sample data:create table orders(orders int,product char(1),order_value float,product_values float)insert into orders values (223, 'A', 11, 11)insert into orders values (224, 'A', 11, 11)insert into orders values (225, 'A', 13, 11)insert into orders values (225, 'B', 13, 2)
and when i run this:select sum(order_value) as order_value ,sum(product_values) as product_valuefrom orders
i get:order_value product_value---------------------- ----------------------48 35(1 row(s) affected)but i should get order value to be the same as product_value, because i want to count orders only once (those which have two or more rows)I've tried with derived table but can't get sum.thank you in advance