PSK-195 sql query fixed for all applications