Right outer join with no ON
-
Hello All! I am trying to debug someone else's stored procedure. I see a RIGHT OUTER JOIN clause with no ON reference. It goes in this form:
select
*
from
a inner join b on a.id=b.id
inner join c on a.id=c.id
right outer join e
inner join f on e.id = f.idStrange part it is does not complain of syntax error. When I try to re-write the same sql, it straight out errors out! I don't know how the previous developer was able to compile the code!! Thanks!!!
-
Hello All! I am trying to debug someone else's stored procedure. I see a RIGHT OUTER JOIN clause with no ON reference. It goes in this form:
select
*
from
a inner join b on a.id=b.id
inner join c on a.id=c.id
right outer join e
inner join f on e.id = f.idStrange part it is does not complain of syntax error. When I try to re-write the same sql, it straight out errors out! I don't know how the previous developer was able to compile the code!! Thanks!!!
No idea, but which database system?
-
Hello All! I am trying to debug someone else's stored procedure. I see a RIGHT OUTER JOIN clause with no ON reference. It goes in this form:
select
*
from
a inner join b on a.id=b.id
inner join c on a.id=c.id
right outer join e
inner join f on e.id = f.idStrange part it is does not complain of syntax error. When I try to re-write the same sql, it straight out errors out! I don't know how the previous developer was able to compile the code!! Thanks!!!
Assumption is that you are using SQL Server! I often see this when using the query designer to create a view, I think it means e is not used in the data but is required get to f so the query builder simply does the join in this fashion. I ALWAYS break this out and create the additional joins through to f, it is more understandable. Caveat This may be completely wrong (I never bothered to investigate the issue) and is probably technically incorrect but it is more readable.
Never underestimate the power of human stupidity RAH
-
Assumption is that you are using SQL Server! I often see this when using the query designer to create a view, I think it means e is not used in the data but is required get to f so the query builder simply does the join in this fashion. I ALWAYS break this out and create the additional joins through to f, it is more understandable. Caveat This may be completely wrong (I never bothered to investigate the issue) and is probably technically incorrect but it is more readable.
Never underestimate the power of human stupidity RAH
Mycroft Holmes wrote:
the query designer
Blech, filth. X|