I am using NETEZZA and I have two separate tables that I would like to join by the date. In the first table, the date is stored as type "date" (e.g., 2014-09-10) while in the second table, the date is stored as type "int4" (20140910). I've tried joining the tables by the date:
select *
from table1 a inner join table2 b
on date(a.start_date) = to_date(b.start_date, 'YYYYMMDD')
This runs but is slow. It's been recommended to me that the comparison might be much faster if I could cast the date in table1 as int4 and then simply compare int4's. However, I couldn't find a way to do this or if this is even the best way.