select no, dateofbirth
from MASTER
where to_char(dateofbirth,'YYYY') = 0
or to_char(dateofbirth,'YYYY') <= -4713
or to_char(dateofbirth,'YYYY') >= 9999