I would like to do as follows:
Select * from
table1 a
inner join table2 b
on
a.id = b.id
if (some condition is met) // Now it gets interesting!
begin
and a.name = b.name
end
Obviously, this doesn’t work.
How can this best be accomplished?
Thanks Stackers!
I would use something like this:
If you really want to put it in the join condition, you could do something like this:
but I think the first form is more clear.
EDIT: as @James Curtis noted in the comments: