SQL MAIN= SELECT distinct(ref_product.id),ref_product.catalogpartcode,date(lastedited) as 'ledate',imageurl,entrytype,upc FROM ref_product WHERE ref_product.EntryType IN('basepart','bundle','kit') AND ref_product.active='1' AND ref_product.manufacturerid IN(select id from lslocal.site_manufacturers where active='1') and catalogpartcode >= '6003218' and catalogpartcode <= '60072/4lp' order by ref_product.catalogpartcode,ref_product.id ;