MySQL Forums
Forum List  »  Newbie

Re: select if appears twice
Posted by: Kamil Rosiński
Date: March 11, 2017 02:40PM

Benoit St-Jean Wrote:
-------------------------------------------------------
> You need something like this:
>
> SELECT username, project, COUNT(*) as
> number_of_roles
> FROM userprojects
> GROUP BY username, project
> HAVING COUNT(*) > 1

Thanks!

But if I'm not wrong, it will count how many roles had user.
But I need to filter users who had more than 1 role IN ONE PROJECT.

Options: ReplyQuote


Subject
Written By
Posted
March 11, 2017 09:18AM
Re: select if appears twice
March 11, 2017 02:40PM
March 24, 2017 03:21AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.