Joining a TABLE to more than one TABLE
I am using 11.05 for Delphi 2009 with SQL Server and ADO.
I would like to join TABLE3 to the query referencing a column in TABLE1 and
TABLE2. I want all three tables in the main query. Also, I want to make
the TABLE3 join a left outer join so I can't add the extra join information
in the where clause.
Is there a way to join a table to a query against more than one table?
I would like to join TABLE3 to the query referencing a column in TABLE1 and
TABLE2. I want all three tables in the main query. Also, I want to make
the TABLE3 join a left outer join so I can't add the extra join information
in the where clause.
Is there a way to join a table to a query against more than one table?
This discussion has been closed.
Comments
This can be done in DADE using the Query Designer. In the Tables tab,
simply add multiple tables to the lower list. Once you do, the join dialog
will appear where you can assign joining fields and determine which type of
join to use.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
I'm sorry but I do not understand what you mean by "join a table to multiple
tables". Perhaps if you give me an example of what this would look like in
SQL code.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
No problem. Something like this...
SELECT T1.COLUMN1, T3.COLUMN2
FROM TABLE1 T1
LEFT OUTER JOIN TABLE2 T2 ON (T1.KEY1 = T2.KEY1) -- this work fine
LEFT OUTER JOIN TABLE3 T3 ON (T1.KEY1 = T3.KEY1 AND T2.KEY2 = T3.KEY2)
The last join can't be done in Query Designer since I want to link to T1 and
T2 in a single LEFT OUTER JOIN.
Thanks for the clarification. You are correct, it is not currently possible
to create a single join on multiple fields from multiple tables using the
Query Designer. This is a capability we will consider adding for a later
release of ReportBuilder.
Currently you will need to edit the SQL manually if you want to perform this
task.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Thanks Nico. I would love to see this feature. In the meantime, I'll keep
making "custom report helper" views.