I am having trouble grouping the dates in my code.

This is my code so far:

```
df_tipReview = spark.sql("""
SELECT R.user_id, R.date, COUNT(R.review_id), T.date
FROM reviews AS R INNER JOIN tips AS T
ON R.user_id = T.user_id
GROUP BY R.date, T.date, R.user_id
""")
df_tipReview.show(truncate=False)

```

Output: 

<https://i.stack.imgur.com/5EQMe.png>

As you can see, the same `user_id` has the same date listed, how would I aggregate that in Spark SQL so that it would essentially look like: 

`|-55DgUo52I3zW9RxkZ-EAQ|2015-11-11| 3`

Instead of having that it on multiple lines.

Thanks.

So when I tried to use the distinct function as below:

```
df_tipReview = spark.sql("""
SELECT DISTINCT R.user_id, R.date, COUNT(R.review_id), T.date
FROM reviews AS R INNER JOIN tips AS T
ON R.user_id = T.user_id
GROUP BY R.user_id, R.date, T.date
""")
df_tipReview.filter("R.user_id='-55DgUo52I3zW9RxkZ-EAQ'").show(truncate=False)

```

This is the output:
<https://i.stack.imgur.com/ercES.png>