I have a **table A** which contains the following information.

```
+----+-------+-------+-----+--------+-----------+
| ID | jobID | user  | ip  |  time  | userAgent |
+----+-------+-------+-----+--------+-----------+
|  1 | uuid1 | user1 | IP1 | Epoch1 | JSONB1    |
|  2 | uuid1 | user1 | IP2 | Epoch2 | JSONB2    |
|  3 | uuid2 | user3 | IP3 | Epoch3 | JSONB3    |
|  4 | uuid1 | user2 | IP4 | Epoch2 | JSONB2    |
|  5 | uuid1 | user4 | IP5 | Epoch4 | JSONB4    |
|  6 | uuid1 | user1 | IP2 | Epoch2 | JSONB2    |
+----+-------+-------+-----+--------+-----------+

```

**I only want the unique occurrences of (jobID & user) and concatenate the results of users in the following manner.**

> 
> 
> ```
> +-------+-------------------+-------------+
> | jobID |       user        | count(user) |
> +-------+-------------------+-------------+
> | uuid1 | user1,user2,user4 |           3 |
> | uuid2 | user3             |           1 |
> +-------+-------------------+-------------+
> 
> ```
> 
> 

Right now I have written a query like 

```
SELECT
 DISTINCT 
  "jobID",
  "user"
 FROM
  "A"
 ORDER BY
  "jobID",
  "user";

```

and it gives me

```
+-------+-------+
| jobID | user  |
+-------+-------+
| uuid1 | user1 |
| uuid1 | user1 |
| uuid2 | user3 |
| uuid1 | user2 |
| uuid1 | user4 |
+-------+-------+

```