All pastes #10226 Raw Edit

bad query

public sql v1 · immutable
#10226 ·published 2005-04-24 21:53 UTC
rendered paste body
SELECT c.* , SC.name SCName , BC.name BCName , P.customer_name PName , P.id PID ,a.id as address_id ,a.address1 ,a.address2 ,a.city ,a.state ,a.zip ,a.country ,a.type as address_type ,a.current_address ,cont.id as contact_id ,cont.external_id ,cont.first_name ,cont.last_name ,cont.middle_name ,cont.alternate_name ,cont.title ,cont.job_title ,cont.home_phone ,cont.mobile_phone ,cont.work_phone ,cont.fax ,cont.email ,cont.preferred_contact ,cont.notes ,m.lead_id as map_lead_id ,m.customer_id as map_customer_id ,m.folio_id as map_folio_id ,m.folio_item_id as map_folio_item_id ,m.con_level as map_con_level ,m.con_type as map_con_type ,lead.uk_nam_ent ,lead.name as lead_name ,lead.id as lead_idFROM om_customer c , core_country SC , core_country BC , om_customer P , OM_LEAD leadLEFT JOIN OM_ADDRESS A ON a.id_customer = c.id AND a.active = 1LEFT JOIN OM_CONTACT_MAP m ON c.id = m.customer_id AND m.active = 1LEFT JOIN OM_CONTACT cont ON cont.id = m.contact_id AND cont.active = 1WHERE c.active = 1 and c.id = 'OCST000000010822' and c.ship_country = sc.id and sc.active = 1 and c.bill_country = bc.id and bc.active = 1 and p.id = c.parent_id and p.active = 1 and lead.id = c.ns_cust_id and lead.active = 1