Record counting

[b]myTable1[/b]

(id)
 1
 2
 3
 4
 5

[b]myTable1[/b]

(in) (out)

 2    1
 3    1
 4    1
 5    2

I have myTables like the above.

When a variables is 1, the query below produces the result below.

[b]code[/b]

SELECT id
FROM myTable1 mm 
WHERE mm.id<>[COLOR="Red"]1[/COLOR]
AND mm.id IN (SELECT myTable2.in FROM myTable2 WHERE myTable2.out=[COLOR="red"]1[/COLOR])

[b]result[/b]

2
3
4

I like to know the number of the result above in SQL.
The trial code1 below seems not to work.

[b]trial code1[/b]
SELECT count(*) as count
FROM myTable1 mm 
WHERE mm.id<>[COLOR="Red"]1[/COLOR]
AND mm.id IN (SELECT myTable2.in FROM myTable2 WHERE myTable2.out=[COLOR="red"]1[/COLOR])

[b]target result[/b]

3

If I should use GROUP BY for getting COUNT, how can I use GROUP BY in this case?

The trial code2 and the trial code3 below are all failed.

[b]trial code2[/b]
SELECT count(*) as count
FROM myTable1 mm 
WHERE mm.id<>[COLOR="Red"]1[/COLOR]
AND mm.id IN (SELECT myTable2.in FROM myTable2 WHERE myTable2.out=[COLOR="red"]1[/COLOR])
GROUP BY [COLOR="Red"]myTable2.out[/COLOR]

[b]trial code3[/b]
SELECT count(*) as count
FROM myTable1 mm 
WHERE mm.id<>[COLOR="Red"]1[/COLOR]
AND mm.id IN (SELECT myTable2.in FROM myTable2 WHERE myTable2.out=[COLOR="red"]1[/COLOR])
GROUP BY [COLOR="Red"]myTable2.in[/COLOR]

Care to explain what ‘seems not to work’ mean? Do you get an error? Do you get a result different from 3? If so, what result do you get?