Use a LEFT JOIN.
If the count is 0 the row is not in Table1.
If the count is 1 but the column from Table2 is null the row is in Table1 but not in Table2.
If the column from Table2 is not null, the number is in both tables.
$query = "select table2.mycolumn from table1 left join table2 where table1.Number = '$number' and table1.Number = table2.Number";