>>122
どっちかつーとプログラム板じゃねぇ?

select a.auto,b.id from a inner join b on a.num = b.id