Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I'd like to do something like this:

SELECT t1.*, t2.* FROM t1 LEFT JOIN t2 ON t1.id=t2.id AND t1.field1=false

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?

Edit: I got Syntax error in JOIN operation and JOIN expression not supported and Invalid argument to function.

Edit2: To prevent further misunderstanding and "put in the WHERE clause" comments. <code>t1</code> table <code>t2</code> table

SELECT t1.*, t2.* FROM t1 LEFT JOIN t2 ON t1.id=t2.id simple <code>LEFT JOIN</code>

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. how it works in ORACLE but not in MS

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
151 views
Welcome To Ask or Share your Answers For Others

1 Answer

If you want to apply a filter to the dataset, try using WHERE in place of AND in your query.

SELECT t1.*, t2.* FROM t1 LEFT JOIN t2 ON t1.id=t2.id WHERE t1.field1=False


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...