问题
I have table that "reviewers" as a id and a name
ID | Name
1 | Coolboy
Now i have table "Orders" that has a foreign key to the "reviwers" table
Order No | Date | ID |
now some the fields in the "orders" table is null,
so in that case the sql is not working:
select o.[order no], o.[date], r.[name] orders o, reviewers r where o.ID = r.ID
If there are null values in the "Orders" table then how to show the rows.
how to mix this query with a where clause:
SELECT O.[Order No], O.[Date], [R.Name], i.[inv_date] FROM Reviewers R, Invoices i
LEFT JOIN Orders O ON O.ID = R.ID where o.[inv_no] = i.[inv_numb]
I have come up with a new question:
replace multiple left joins in access sql
Thanks
Pradyut
来源:https://stackoverflow.com/questions/12465065/no-values-if-null-in-the-referenced-table-sql-access