Given this SQL query (which uses the old style "WHERE" clause to do joins):
Can someone translate to use "JOIN" statements instead of using the "WHERE" statement? In particular, Im not quite sure how to translate this line
Thanks in advance,
flynn
Code:
SELECT
c.cust_id, c.name, c.address_1, c.address_2, c.address_3, c.city, c.state, c.zipcode,
co.first_name, co.last_name , co.fax,
sr.rep_name, sr.rep_phone, sr.rep_fax, sr.rep_email
FROM
customer c, contact co, sales_rep sr, customer_price cp
WHERE
( c.static_cust_numb = cp.static_cust_numb ) and
( c.rep_id = sr.rep_id ) and
( cp.sales_code = @cp_sales_code ) AND
( c.employee_number = sr.employee_number or ( sr.territory = @sr_territory and sr.branch = c.branch )) AND
( c.status <> @customer_status ) AND
( c.rep_id = @rep_id ) AND
( co.default_contact = Y AND c.static_cust_numb = co.static_cust_numb )
Can someone translate to use "JOIN" statements instead of using the "WHERE" statement? In particular, Im not quite sure how to translate this line
Code:
( c.employee_number = sr.employee_number or ( sr.territory = @sr_territory and sr.branch = c.branch )) AND
Thanks in advance,
flynn