I have a Oracle database table like so, which records an item being scanned at a scanning point.
ItemsScan
ItemScanId
ItemScanPoint
ItemType
ScanTime
I want to return the ItemScanPoint along with the number of times a specific ItemType was scanned at that ItemScanPoint.
Something along the lines of..
SELECT ItemScanPoint,
(SELECT COUNT(*) WHERE ItemType = 1),
(SELECT COUNT(*) WHERE ItemType = 2)
FROM ItemsScan
How do I do this in oracle?
What is the most efficient way?
1 Answer