NULL + condition

[b]myTable5[/b]
(id) mem
[COLOR="Blue"](1)   1[/COLOR]
[COLOR="green"](1)   2[/COLOR]
[COLOR="blue"](2)   1[/COLOR]
[COLOR="green"](2)   2[/COLOR]
[COLOR="blue"](3)   1[/COLOR]
[COLOR="green"](3)   2[/COLOR]
[COLOR="blue"](4)   1[/COLOR]
[COLOR="green"](4)   2[/COLOR]
[COLOR="blue"](5)   1[/COLOR]

[b]myTable5[/b]
(id) mem
[COLOR="blue"](1)  1[/COLOR]
[COLOR="Green"](1)  2[/COLOR]
[COLOR="blue"](2)  1[/COLOR]
[COLOR="blue"](4)  1[/COLOR]
[COLOR="green"](4)  2[/COLOR]
[COLOR="blue"](5)  1[/COLOR]

I have data in myTable5 and myTable6 like the above.

The code1 below added mem=1 in WHERE CLAUSE produces the result below

[b]code1-1[/b]
select id, mem from myTable5
where [COLOR="Blue"]mem=1[/COLOR]

[b]result1-1[/b]
[COLOR="Blue"](1) 1
(2) 1
[COLOR="Red"](3) 1[/COLOR]
(4) 1
(5) 1[/COLOR]

[b]code1-2[/b]
select id, mem from myTable6
where mem=[COLOR="blue"]1[/COLOR]

[b]result1-2[/b]
[COLOR="blue"](1) 1
(2) 1
(4) 1
(5) 1[/COLOR]

The code2 below added mem=2 in WHERE CLAUSE produces the result below

[b]code2-1[/b]
select id, mem from myTable5
where [COLOR="green"]mem=2[/COLOR]

[b]result2-1[/b]
[COLOR="Green"](1) 2
[COLOR="Red"](2) 2
(3) 2[/COLOR]
(4) 2
[/COLOR]


[b]code2-2[/b]
select id, mem from myTable6
where [COLOR="green"]mem=2[/COLOR]

[b]result2-2[/b]
[COLOR="Green"](1) 2
(4) 2
[/COLOR]

I like to produce my target result below


when [COLOR="Blue"]mem=1[/COLOR]
[b]target result[/b]
[COLOR="red"](3)[/COLOR]


when [COLOR="green"]mem=2[/COLOR]
[b]target result2[/b]
[COLOR="Red"](2) 
(3)[/COLOR]

The followings are some of my trials for getting my target result.

[b]trial code1[/b]
select myTable5.id from myTable5
left join myTable6 on myTable6.id=myTable5.id
where myTable6.id is null and myTable5.mem=2
[b]trial result2[/b]
(3)

[b]trial code2[/b]
select myTable5.id from myTable5
left join myTable6 on myTable6.id=myTable5.id
where myTable5.mem=2 and myTable6.id is null

[b]trial result2[/b]
(1)
(4)

[b]target result[/b]
(2)
(3)
SELECT myTable5.id 
  FROM myTable5
LEFT 
  JOIN myTable6 
    ON myTable6.id  = myTable5.id
   [COLOR="Blue"]AND myTable6.mem = myTable5.mem[/COLOR]  
 WHERE myTable5.mem = 2 [I][COLOR="DimGray"]-- or 1[/COLOR][/I]
   AND myTable6.id IS NULL

It is very cool of you, thank you.