I'm trying to count the number of occurrences for the same title.
My Code
SELECT
client AS Client,
datescanned as "Date Scanned",
scanner AS Scanner,
risk AS Risk,
host AS Host,
name AS Title,
solution AS Solution
FROM sss1webapp_latest
WHERE risk regexp "Critical|High"
AND client = "myself"
group by Title;
UNION
SELECT
client AS Client,
datescanned as "Date Scanned",
scanner AS Scanner,
AttackScore AS Risk,
WebSite AS Host,
AttackType AS Title,
Recommendation AS Solution
FROM sss2webapp_latest
WHERE AttackScore regexp "5-Critical|4-High"
AND client = "myself"
My Table (just a representation, didn't added all fields...)
client datescanned title ....
myself 2019-03-11 Backported Security Patch
myself 2019-03-11 Backported Security Patch
myself 2019-03-11 Backported Security Patch Detection (SSH)
myself 2019-03-11 Backported Security Patch Detection (SSH)
myself 2019-03-11 Backported Security Patch Detection (SSH)
myself 2019-03-11 Backported Security Patch Detection (SSH)
myself 2019-03-11 SSL Version Issues
My desired output
count client datescanned title
2 myself 2019-03-11 Backported Security Patch
4 myself 2019-03-11 Backported Security Patch Detection (SSH)
1 myself 2019-03-11 SSL Version Issues
(adding count and group same title and counting the # of occurrences.
Tried adding count(0)as tcount, after the select statement but error.
Feedback welcome! Thx! Nathalie