<p>I have a table that has a <code>processed_timestamp</code> column -- if a record has been processed then that field contains the datetime it was processed, otherwise it is null.</p>

<p>I want to write a query that returns two rows:</p>

<pre><code>NULL        xx -- count of records with null timestamps
NOT NULL    yy -- count of records with non-null timestamps
</code></pre>

<p>Is that possible?</p>

<p><strong>Update:</strong> The table is quite large, so efficiency is important. I could just run two queries to calculate each total separately, but I want to avoid hitting the table twice if I can avoid it.</p>

In MySQL you could do something like
```
```
SELECT 
    IF(ISNULL(processed_timestamp), 'NULL', 'NOT NULL') as myfield, 
    COUNT(*) 
FROM mytable 
GROUP BY myfield
```
```