unique - remove SQL duplicate values, distinct not working -
select bm.puser, bm.desc, bm.price, bm.info, cast (case when bi.closed = 'e' bq.qty-bq.consign-(sum(bd.qtysold)) else bq.qty-bq.consign end int) stock binvoice bi , bdetail bd , bqty bq , bmaster bm (bd.user = bi.user) , (bq.partno = bd.partno) , (bq.partno = bm.partno) , (bm.price > 0.01) , (bm.active = 'y') group bm.puser, bm.price, bm.desc, bm.info, bq.consign, bq.qty, bi.closed
my issue want 1 of each puser display, of them appear multiple times. believe case have made coming from. not quite sure how around this. using select distinct did not work me. guidance appreciated. used on nexusdb.
use distinct select distinct column_name,column_name table_name;
select distinct bm.puser, bm.desc, bm.price, bm.info, cast (case when bi.closed = 'e' bq.qty-bq.consign-(sum(bd.qtysold)) else bq.qty-bq.consign end int) stock binvoice bi , bdetail bd , bqty bq , bmaster bm (bd.user = bi.user) , (bq.partno = bd.partno) , (bq.partno = bm.partno) , (bm.price > 0.01) , (bm.active = 'y') group bm.puser, bm.price, bm.desc, bm.info, bq.consign, bq.qty, bi.closed
Comments
Post a Comment