**Context**

I have a table that has a column that acts like a "key" value. The same key value could appear in multiple rows and I want to `SELECT` only rows that contain keys that don't appear in multiple rows. For example, if input table is:

```
key  |  col1  |  col2  |  other columns
_______________________________________
1       1337     1338
1       1339     1340
2       1341     1342
3       1343     1344
3       1345     1346
4       1347     1348
5       1349     1350
5       1351     1352
5       1353     1354

```

Output should be:

```
key  |  col1  |  col2  |  other columns
_______________________________________
2       1341     1342
4       1347     1348

```

---

**Question**

Can I do this efficiently without populating a third table?

---

**What I Tried**

```
SELECT key, col1, col2, other columns
FROM input_t
WHERE COUNT(col1) = 1
GROUP BY key

```

However this is not a valid query. Also what if col1 is NULL? I still want the row (key, col2, other columns).

```
SELECT key, col1, col2, other columns
FROM input_t
GROUP BY key
HAVING COUNT(col1) = 1

```

Not a valid query either.

I have tried using `DISTINCT` but that doesn't ignore the keys that appear multiple times. It also does not make logical sense for me to aggregate the other columns.