I never worked with pgsql before and im trying to convert this function to Mysql... can you give me a hand?
create or replace function hot(ups integer, downs integer, date timestamp with time zone) returns numeric as $$
select round(cast(log(greatest(abs($1 - $2), 1)) + sign($1 - $2) * (date_part('epoch', $3) - 1134028003) / 45000.0 as numeric), 7) $$ language sql immutable
EDIT:
So far i've got this but it still gives me an error
create function hot(ups MEDIUMINT, downs MEDIUMINT, date timestamp) returns BIGINT
select round(cast(log(greatest(abs($1 - $2), 1)) + sign($1 - $2) * (unix_timestamp(date) - 1134028003) / 45000.0 BIGINT), 7)
$$ language sql immutable
"You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'BIGINT), 7) $$ language sql immutable' at line 2"