no values if null in the referenced table sql access

╄→尐↘猪︶ㄣ 提交于 2019-12-12 03:49:20

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!