General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
I am trying to get many fields from table A and if present, one field from table B, otherwise .Null. from table B. I always want all of the records that meet the where clause criteria from table A. That is the number of records I want no matter what table B has or doesn't have. I have tried every kind of join of table B and never get the correct number of records. The correct number of records is 74. Here are the results.
No Join, all from table A - 74 records
Join table B - 28
left join table B - 87
left outer join table B - 87
right join table B - 28
right outer join table B - 28
inner join table B - 28
from tableA, table B - 24,790
where tableA.field = tableB.field - 28
I want the 74 records every time and I can come up with no way to get them and only them. Can anyone help.
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only