5 replies
by jboardman
You need to set up a left or right join relationship within the query. In SQL, it looks like this:
SELECT DISTINCTROW [table1].[field] FROM [table1] LEFT JOIN table2 ON [table1].linkkey = table2.linkkey WHERE (where clause);
table1 is the tableyou want to show ALL the records from and table2 is the table from which you only want records that match anything in table1.
This should also solve the problem with the blank fields.
You may find, if it's a complex query, that you'll have to break it into sub-queries doing one or two joins and filters on the way up. Let me know if you have a problem.
by froehlke-km
You would need to use an 'Outer Join Query' for your case.
An outer join would return all the records that satisfy the join condition and also the records from one table for which no records from the other table would satisfy the join condition.
To write a query that performs an outer join of tables A and B and returns all rows from A, apply the outer join operator (+) to all columns of B in the join condition. For all rows in A that have no matching rows in B, the query would return null for any select list expressions containing columns of B.
by froehlke-km
by froehlke-km
This discussion is closed to new replies.
Trending Software posts
Sort by Trending