this is my query
and this is the result set
Its in multiples of 4 at first then 2 then 1 even thought there should technically only be 2 lines returned
WHat am i doing wrong?
Code:
select distinct * from (select distinct city,itm__code,barcode1 from bx_itembarcodemaster where city = 'jhb' and (barcode1 is not null and bqty1 is not null) ) jhb left join ( select distinct city,itm__code,barcode1 from bx_itembarcodemaster where city = 'cpt' and (barcode1 is not null and bqty1 is not null) ) cpt on cpt.itm__code = jhb.itm__code left join ( select distinct city,itm__code,barcode1 from bx_itembarcodemaster where city = 'dbn' and (barcode1 is not null and bqty1 is not null) ) dbn on dbn.itm__code = jhb.itm__code
Code:
JHB 0-16040 0-16040 CPT 0-16040 0-16040 DBN 0-16040 0-16040 JHB 0-16040 0-16040 CPT 0-16040 0-16040 DBN 0-16040 6002303714622 JHB 0-16040 0-16040 CPT 0-16040 6002303714622 DBN 0-16040 0-16040 JHB 0-16040 0-16040 CPT 0-16040 6002303714622 DBN 0-16040 6002303714622 JHB 0-16040 6002303714622 CPT 0-16040 0-16040 DBN 0-16040 0-16040 JHB 0-16040 6002303714622 CPT 0-16040 0-16040 DBN 0-16040 6002303714622 JHB 0-16040 6002303714622 CPT 0-16040 6002303714622 DBN 0-16040 0-16040 JHB 0-16040 6002303714622 CPT 0-16040 6002303714622 DBN 0-16040 6002303714622
WHat am i doing wrong?
Comment