I’m migrating my MySQL databases to PostgreSQL. While connecting database to my Python script I’m getting some syntax error. So could you please convert this MySQL query into PostgreSQL:
select ifnull((select ifnull(run_id,0) from searchbank order by run_id desc limit 0,1),0)
Postgres doesn’t support ifnull:
You might find this version slightly cleaner and clearer: