具有多个条件的左访问联接 [英] ACCESS LEFT JOIN with multiple criteria
问题描述
我想做这样的事情:
从t1左联接t2上选择t1.*,t2.* t1.id = t2.id AND t1.field1 = false
因此,我不想从 t2
表中看到来自 t1
表中那些记录的数据,其中 t1.field1 = false
.在ORACLE中有可能,但是在MS ACCESS中有可能吗?
So, I don't want to see data from t2
table for those records from t1
table where t1.field1=false
.
It's possible in ORACLE, but is this possible in MS ACCESS?
我在JOIN操作中出现语法错误
,并且 JOIN表达式不受支持
和函数的无效参数
.
I got Syntax error in JOIN operation
and JOIN expression not supported
and Invalid argument to function
.
Edit2:为防止进一步的误解和放入 WHERE
子句"的注释.
To prevent further misunderstanding and "put in the WHERE
clause" comments.
选择t1.*,t2.*从t1左联接t2到t1.id = t2.id
如果您在ORACLE中编写我的第一个 SELECT
,您将看到此信息(我必须在MS中执行此操作).我想查看 t1
表中的所有记录,但是我不想联接每条记录,而只想联接 t1.f1 = false
的地方.您可以看到 id = 2
和 id = 5
.
If you write my very first SELECT
in ORACLE, you will see this (and I have to do it in MS). I want to see ALL records from t1
table, but I don't want to join every record, but only where t1.f1=false
. You can see that where id=2
and id=5
.
推荐答案
我通过多个 SELECT
设法获得了期望的结果,如果您有一个长且多个 SELECT的选项,那真是令人作呕
首先.
I managed to get the desired result with multiple SELECT
, which is disgusting, if you have a long and multiple SELECT
in the first place.
SELECT t1.*,a.c1从t1左联接(选择t2.*从t1左联接t2打开t1.id = t2.id其中t1.f1 = false)作为开启t1.id = a.id
这篇关于具有多个条件的左访问联接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!