Added table reference in sql query