Fix query outdated in Oracle