Thus:
SELECT COUNT(*) AS QTD FROM AtivacaoGuincho
WHERE DataFim is null
Since Marlon brought up the subject of line accounting I can improve on a
little more that answer and get into a subject that is almost a curiosity.
Count is basically used in this way above. I request that you count all lines WHERE THE END IS NULL.
But I could do so:
SELECT COUNT(*) AS TOTAL, COUNT(DATAFIM) AS DTFIM FROM AtivacaoGuincho
And it would have something like this: I have 1884 rows in the table and 50 rows where DATAFIM is null.
And of course, I could have as many Counts as I wanted in my select.
If you can, try
SELECT COUNT(*) - COUNT(DataFim) AS qtd
and tell me if it works.– Bacco