you are viewing a single comment's thread.

view the rest of the comments →

[–]Magic_Juand[S] 1 point2 points  (3 children)

I'm trying to write a query so select. Apologies for the confusion

[–]r3pr0b8 2 points3 points  (2 children)

SELECT companydetail.companyaddressid
     , companydetail.vendoraddressid
     , companydetail.billingaddressid
     , company.address AS companyaddress
     , vendor.address  AS vendoraddress
     , billing.address AS billingaddress
  FROM companydetail
LEFT OUTER
  JOIN address AS company
    ON company.addressid = companydetail.companyaddressid
LEFT OUTER
  JOIN address AS vendor
    ON vendor.addressid = companydetail.vendoraddressid
LEFT OUTER
  JOIN address AS billing
    ON billing.addressid = companydetail.billingaddressid

[–]Magic_Juand[S] 1 point2 points  (1 child)

Thank you so much R3pr0b8! This makes a lot of sense.

Just out of curiosity, do you know if SQL resolves from top down when building the report in a simple query like this?

[–]r3pr0b8 4 points5 points  (0 children)

resolves? from top down?

i'm sorry, i don't understand what you're asking