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

SELECT DISTINCT valori e INSERT INTO table

Puoi usare INSERT INTO... SELECT dichiarazione in merito,

INSERT INTO tableName (A, B, C)
SELECT A, B, MAX(C) + 1
FROM tableName
GROUP BY A, B