I have a table `items` and a table `batches`. A batch can have n items associated by `items.batch_id`.

I'd like to write a query item counts in two groups `batched` and `unbatched`:

1. items WHERE batch\_id IS NOT NULL (batched)
2. items WHERE batch\_id IS NULL (unbatched)

The result should look like this

| batched | unbatched |
| --- | --- |
| 1200000 | 100 |

Any help appreciated, thank you!

EDIT:
I got stuck with using `GROUP BY` which turned out to be the wrong tool for the job.