Fix or cond. for sqlite, mysql and postgres