I'm looking to create a Python script that displays the items that are no longer available in the store (location 1) but are available in the warehouse (location 99). E.g. a list with items needed to be restocked. The difficulty is, that instead of putting the item count on 0 for the store, the inventory management system just removes the item completely from the database. Plus the fact that items don't have a unique ID, but are a combination of two columns being serial number and the column with the item's size.

The (PostgreSQL) database is `restock` with one table `inventory` looking like this:

```
====================================================================
| serialnumber  | size     | location     | itemcount   | season   |
--------------------------------------------------------------------
| 1120.10.0369  | 140      | 99           | 8           | 74       |
| 1120.10.0369  | 140      | 1            | 2           | 74       |
| 1120.10.4011  | 170/176  | 99           | 3           | 74       |
| 1120.10.4011  | 170/176  | 1            | 2           | 74       |
| 1120.10.4011  | 86/92    | 99           | 1           | 74       |
| 1120.10.8006  | 158      | 99           | 1           | 74       |
| 1120.10.8006  | 158      | 1            | 2           | 74       |

```

In the above example, the item with serial number `1120.10.4011` and size `86/92` is available in location `99` (the warehouse) but there is no row with serial number `1120.10.4011` and size `86/92` where location is `1`, so that item I want to have on a list to be restocked.

I'm trying to show the items that don't exist in the data do this by using a count on a `GROUP BY` query:

```
getresult = "SELECT serialnumber, size, location, itemcount, season, COUNT(*)" + \
            "FROM inventory " + \
            "WHERE season = 74" + \
            "AND location != 1" + \
            "GROUP BY serialnumber, size " + \
            "HAVING COUNT(*) < 1"

```

However, this doesn't work as expected. 

The question still stands:

* How can I retrieve a list with rows missing from the database?

Or 

* How can I retrieve a list with rows where the serialnumber + size are there for location 99 but are not present with a location of 1?