The join is arguably the most important part of SQL, and when one of our coders gets it wrong, the most troublesome. We implemented a formatting standard to expedite clarity of reading the joins for the really complex ones, that involve AND or OR. It really is just aligning the AND/OR keywords with the ON. Code would look something like:
SELECT
na.*
, zian.abbr
, net.field2
FROM note_actions na
INNER JOIN myschema.tbl_edit_trail net ON na.note_id = net.note_id
INNER JOIN myschema.tbl_emp emp ON emp.user_id = net.user_id
AND emp.prac_id = na.prac_id
INNER JOIN myschema.tbl_nose zian ON net.nose_c = zian.note_c
OR na.nose_c = zian.note_c
WHERE
zian.abbr = 'CON'
Currently, I cannot figure out how to do this with SQLinForm





