Wednesday, March 7, 2012

help typical error inner join

hi, all

i am having what is considered to be typical error, i have two tables in sql2000 database

(options) orderid, productid, productname,optionvalue
(orderitems) orderid, quantity, unitprice,productcode,productid

I'd like to join these 2 tables and be able to display in a repeater. the problem is that i keep getting some duplicates with sql statement

"SELECT DISTINCT
options.orderid,options.productname,options.optionvalue,orderitems.quantity,orderitems.productcode
FROM options INNER JOIN on orderitems on
options.[orderid] = orderitems.[orderid] "

PLEEEASE HELP ME SLEEP AT NIGHT:)
thanksAdd this and remove the DISTINCT:

GROUP BY option.orderid, options.productname,option.optionvalue,orderitems.quantity,orderitems.productcode

No comments:

Post a Comment