Excuse me for the question.
I am currently creating a web application with STS. I would like to get the number of people who meet condition A and the number of people who meet condition B from the user master on the screen for collecting statistics with a single query.
I wrote the following JPQL statement, select new MyClass( count(nullif(m.Column,0)) ,count(nullif(m.Column,1))) from TUser t join t.mUser m where t.userId = m.userId...
I get the error ↓. line 1:101: expecting CLOSE, found '('
Isn't JPQL supporting using the nullif function in count? Or is it a matter of syntax writing? I am wondering when I see the example of the person who succeeded when writing nullif alone in the select statement. I'm sorry for my poor question, but I am waiting for your answer.
Environment: Spring Tool Suite 3.8.2 hibernate JPA
Recommended Posts