I have the following problem: I want to filter a list of clients based on their phone number.

My actual output:

```
id  firstname  lastname phonenumber creation date 
1      client    client   664433      2020/01/02
2      client    client   664433      2020/01/02
3      client    client   664432      2020/01/02
4      client    client   669433      2020/01/02
5      client    client   964433      2020/01/02
6      client    client   664033      2020/01/02

```

As you can see, there are phone numbers duplicated.

My desired output should be:

```
id  firstname  lastname phonenumber creation date 
1      client    client   664433      2020/01/02
2      client    client   664432      2020/01/02
3      client    client   669433      2020/01/02
4      client    client   964433      2020/01/02
5      client    client   664033      2020/01/02

```

Here is the code I'm using in order to identify these duplicated numbers and remove them from my output:

```
select 
cc.id ,
cc."FirstName", 
cc."LastName", 
cc."PhoneNumber" as phone_number,
case when cc."PhoneNumber" is not null count(cc."PhoneNumber") else 0,
cc."CreationDate"
from souscritootest.public.clients_crm cc
having count(cc."PhoneNumber") = 1
;

```

The problem is that I'm getting this feedback from the IDE: `SQL Error [42601]: ERROR: syntax error at or near "count" Position: 128`

What I want to do is create a column with the case when to tag with a 1 if it's duplicated and 0 if it's not duplicated.

Thanks!