Subject | LEFT JOIN problem |
---|---|
Author | Sudheer Palaparambil |
Post date | 2005-06-20T15:44:08Z |
Hello,
The following SQL statement is returning only those records which have
a matching record in the right table.
SELECT ST.sale_type_nm, MIN( SL.bill_no ), MAX( SL.bill_no )
FROM sale_type ST LEFT JOIN sale SL ON ( ST.company_id = SL.company_id )
AND ( ST.id = SL.s_type )
WHERE ( SL.entry_date BETWEEN '2.5.05' AND '2.5.05' )
GROUP BY ST.sale_type_nm
What I want is all the record from the left table and null values from
the right table which doesnt have matching record in the left table.
I tried LEFT OUTER JOIN also.
My firebird version is 1.5.2 on Windows 2003.
Please help.
Thank you.
[Non-text portions of this message have been removed]
The following SQL statement is returning only those records which have
a matching record in the right table.
SELECT ST.sale_type_nm, MIN( SL.bill_no ), MAX( SL.bill_no )
FROM sale_type ST LEFT JOIN sale SL ON ( ST.company_id = SL.company_id )
AND ( ST.id = SL.s_type )
WHERE ( SL.entry_date BETWEEN '2.5.05' AND '2.5.05' )
GROUP BY ST.sale_type_nm
What I want is all the record from the left table and null values from
the right table which doesnt have matching record in the left table.
I tried LEFT OUTER JOIN also.
My firebird version is 1.5.2 on Windows 2003.
Please help.
Thank you.
[Non-text portions of this message have been removed]