select from table a inner join table b on a.date