Subject Re: V6s5 & FireBird - Join condition for a self joined table
Author Svein Erling
--- In firebird-support@yahoogroups.com, Venus Software Operations
wrote:
> FROM MSALESREPS MSALESREPS

Ouch Bhavbhuti,
I guess Firebird is confused by you aliasing one of the tables to the
actual name of the table. Try a different name and change your query
to something like:

SELECT MSALESREPS_B.*,
MSALESREPS_A.CNAME AS CSPONNAME,
MSALESREPS_A.CCITY AS CSPONCITY,
MSALESREPS_A.CCODE AS CSPONCODE
FROM MSALESREPS MSALESREPS_B
RIGHT OUTER JOIN MSALESREPS MSALESREPS_A
ON MSALESREPS_B.IPID = MSALESREPS_A.IID
ORDER BY MSALESREPS_B.CNAME, MSALESREPS_B.CCITY

HTH,
Set
- I support Firebird, I am a FirebirdSQL Foundation member.
- Join today at http://www.firebirdsql.org/ff/foundation