May be it don't work because you forgot 'query.first()' after the SELECT statement?