I'm trying to get count of C_ST's with '0' for each Abonent, but don't know how. Tried to find solutions, but nothing works..
The Structure of Database:
QRY_TYPE (ID – unique identifier of type, С_NAME – name of type, C_AB_REF – link to the abonent, who processes these types of messages).
ST_ABONENTS (ID – unique identifier, С_NAME – name)
QRY_QUEUE (ID – unique identifier, С_IN_TIME – date and time of writing msg into table, C_EXEC_TIME – date and time of the msg processing, C_ST – processing status (null - didn't, 1 – successfull, 0 – error with processing), C_QRY_TYPE – link for the query type).
Thats one of my tries, its still doesnt work
SELECT ST_ABONENTS.C_NAME AS "ABONENTNAME",COUNT(QRY_QUEUE.C_ST) AS "CNT"
FROM ST_ABONENTS, QRY_QUEUE
WHERE QRY_QUEUE.C_ST=0
GROUP BY ST_ABONENTS.C_NAME
HAVING COUNT(QRY_QUEUE.C_ST)>0;
Result should looks like this

