sql - select, count, join, group
How can I get this to work, this is being done on an Oracle database. Needs a group by caluse, but not sure where to put it..
select distinct(LEASE.MAC), count(*)
FROM REPORTING.LEASE
JOIN REPORTING.EQUIPMENT
ON LEASE.MAC = EQUIPMENT.MAC
WHERE count(*)>2
AND EQUIPMENT.DEVICETYPE='cm'
GROUP BY count(*);
|