cachaito
10/1/2019 - 11:24 AM

Find how many times something is doubled in DB

SELECT COUNT(current_car_id) as doubled, car_registration_number as reg_num
    FROM taxijakt.wave_drivers
    WHERE car_registration_number is not NULL AND car_registration_number != ''
    GROUP BY car_registration_numberoccurrences
    HAVING COUNT(car_registration_number) > 1
ORDER BY 1 DESC;