We have a very repetitive need to execute UPDATE commands in our Database where only one table is updated, but two additional tables need to be referenced. I've been doing SQL for a long time, but have always seemed to just stick with the basics. I've never used JOINs before. Indexes aside, I'm thinking my SQL in general is inefficient and was hoping if someone could let me know if they think Statement 2 below is not only identical to Statement 1 (currently using this format), but is also more efficient? Statement 1
Statement 2
Any help would be greatly appreciated :) Anthony Mangione (amangione@jatsoftware.com) |
While I would strongly recommend the 2nd form, the 1st form seems to have some errors (e.g. a doubled "AND"). Furthermore, it's hard to tell whether COL_3 is only existing in TABLE_V without knowing the database schema... Could you re-check these statements and possibly format them a bit more similar?