I have a "Leads" table which contains 250 records and is having relationship to the following tables
1. ProductID column in Leads table -> ID column of Products table
2. ApplicantTypeID column in Leads table -> ID column of ApplicantType table
3. OwnerID column in Leads table -> ID column of Users table
4. AssignedToID column in Leads table -> ID column of Users table (Note that I have created 2 tables in server manager)
I have created joins between the tables in such a way that LEADS is always the LEFT table and the other tables are RIGHT. This means that even if the lead does not have a PRODUCTID, that lead should still be visible in the report.
However Seal Report has come up with the following query because of which 210 leads are displayed out of 250 records. Is there anyway I can force Seal to have the query starting with leads table and every other join succeeding this will be a LEFT JOIN
SELECT DISTINCT
Lead.LeadNumber AS C0,
ApplicantType.ApplicantTypeDisplayName AS C1,
Product.ProductDisplayName AS C2,
Owners.Name AS C3
FROM
((
select * from Dimension_Users
) Owners LEFT OUTER JOIN
((
select * from dimension_applicanttype
) ApplicantType RIGHT OUTER JOIN
((
select * from leads
) Lead LEFT OUTER JOIN (
select * from dimension_products
) Product
ON Lead.ProductID = Product.ID)
ON Lead.ApplicantTypeID = ApplicantType.ID)
ON Lead.OwnerID = Owners.ID)
ORDER BY Lead.LeadNumber ASC,ApplicantType.ApplicantTypeDisplayName ASC,Product.ProductDisplayName ASC,Owners.Name ASC
Edited by user Friday, December 8, 2023 6:29:48 AM(UTC)
| Reason: Not specified