All pastes #766157 Raw Edit

||cw

public sql v1 · immutable
·published 2007-11-08 17:35 UTC
rendered paste body
SELECT	tab_cu_address.customer_number,	tab_cu_address.default_shipping,	tab_cu_address.billing_address,	tab_cu_address.NAFTA_region,	tab_cu_address.NAFTA_taxid,	COALESCE(tab_cu_address.use_ups, tab_customers.use_ups) AS use_ups,	COALESCE(tab_cu_address.ups_account, tab_customers.ups_account) AS ups_account,	COALESCE(tab_cu_address.use_fedex, tab_customers.use_fedex) AS use_fedex,	COALESCE(tab_cu_address.fedex_account, tab_customers.fedex_account) AS fedex_account,	COALESCE(tab_cu_address.use_truck_prepaid, tab_customers.use_truck_prepaid) AS use_truck_prepaid,	COALESCE(tab_cu_address.use_freight, tab_customers.use_freight) AS use_freight,	tab_cu_address.use_3rd_party,	com_freight.comment AS frieght_comment,	addr.attn,	addr.address1,	addr.address2,	addr.city,	addr.state,	addr.postal_code,	addr.country,	addr.residential,	com_addr.comment,	nafta.attn AS nafta_attn,	nafta.address1 AS nafta_address1,	nafta.address2 AS nafta_address2,	nafta.city AS nafta_city,	nafta.state AS nafta_state,	nafta.postal_code AS nafta_postal_code,	nafta.country AS nafta_country,	billing_3rd.attn AS billing_3rd_attn,	billing_3rd.address1 AS billing_3rd_address1,	billing_3rd.address2 AS billing_3rd_address2,	billing_3rd.city AS billing_3rd_city,	billing_3rd.state AS billing_3rd_state,	billing_3rd.postal_code AS billing_3rd_postal_code,	billing_3rd.country AS billing_3rd_countryFROM	tab_cu_address JOIN tab_customers ON tab_cu_address.customer_number = tab_customers.customer_number		JOIN tab_address AS addr ON tab_cu_address.address_id = addr.counter		LEFT JOIN tab_comment AS com_addr ON addr.com_id = com_addr.comid		LEFT JOIN tab_comment AS com_freight ON tab_cu_address.use_freight_com_id = com_freight.comid 		LEFT JOIN tab_address AS billing_3rd ON tab_cu_address.address_id_3rd_party = billing_3rd.counter		LEFT JOIN tab_address AS nafta ON tab_cu_address.NAFTA_address_id = nafta.counter