OTC-248

- removed incorrect where condition in sql query