If you are by definition LEFT JOIN, what
- for each row from the left table, it will return the corresponding row from the right table, if exists
- If the right side of the row does not exist, it will still return a row from the table on the left with all columns from the table on the right set to NULL
, ON, true, .
, t1.year - 2010, on false (x AND 2010 = 2009 - false , t1.year = 2010), , ( ).
, .
( , select)
EDIT:
, where JOIN
select t1.*
from t1
left outer join t2
on t1.store = t2.store
or t1.year = '2009'
where t2.store is null
:
t1.store t1.year t2.store t1.store=t2.store t1.year=2009 join(OR)
01 2009 02 false true true
02 2009 02 true true true
03 2009 02 false true true
01 2010 02 false false false
02 2010 02 true false true
03 2010 02 false false false
, false, null t2. *.
, , , , (- , ), ( ).
- - .
ORs , AND (OR , AND). , .
, t1.year = '2009' where, ( ), , , , , , .
t1, 2009 ( , , WHERE).
.
, - , t1.year = '2009' ( ). , , LEFT JOIN where t1.year = 2009 AND t2.store is null , .