I have sql select for which I want write criteria. I was googling some time, but cant find anything for “not in”.
My sql query:
select * from users where username not in(
select users.username from users right join authorities on users.username=authorities.username
where authority='ROLE_ADMIN')
Thanks a lot in advance.
Regards,
Mat
Thanks for the answer, but it’s not exactly like this. You selected all the users with authority “ROLE_ADMIN”, and I needed all the users that are not “ROLE_ADMIN”. smple “not” was not working, because there are users that have “ROLE_ADMIN”, and “ROLE_MODERATOR” in one time. I managed to solve it like this:
It works, but do you think it’s a good solution?