```
SELECT searches.id, searches.tags, STRING_AGG(tags.name,',') tag_list 
FROM searches
INNER JOIN notes ON notes.id = searches.note_id
INNER JOIN tags ON tags.note_id = notes.id
WHERE searches.tags <> 'tags_list'
GROUP BY searches.id
LIMIT 1;

```

I'm getting this result

```
  id   |         tags         |       tag_list
-------+----------------------+----------------------
 40283 | abcde,hello,sed,test | abcde,hello,sed,test

```

I've specified to return only cases where `searches.tags <> 'tags_list'` but am seeing the opposite result.

---

### Sample data

```
SELECT id, tags, note_id FROM searches WHERE searches.note_id = 3;

  id   |            tags             | note_id
-------+-----------------------------+---------
 40285 | at,asperiores,incidunt,unde |       3
(1 row)

SELECT id, name, note_id FROM tags WHERE tags.note_id = 3;

 id |    name    | note_id
----+------------+---------
  6 | at         |       3
  7 | asperiores |       3
  8 | incidunt   |       3
  9 | unde       |       3
(4 rows)

```

I would expect my query does not return search 40285 when I use a `<>` operator. Conversely it would return it if I used a `=` operator.