Sqlserver
 sql >> Database >  >> RDS >> Sqlserver

Numero di occorrenza della query SQL

Questo dovrebbe farlo:

SELECT c.*
FROM cars c
    JOIN
    (
        SELECT carCode 
        FROM articles
        WHERE Accepted = 1
        GROUP BY carCode
        HAVING COUNT(carCode) > 1
    ) a ON c.code = a.carCode