use AdventureWorks2022
GO
DROP INDEX IF EXISTS IX_Person_LastName ON Person.Person
GO
CREATE INDEX IX_Person_LastName ON Person.Person (LastName)
GO
SELECT LastName , COUNT(*)
FROM Person.Person
WHERE LastName IN ('Diaz' , 'Hernandez')
GROUP BY LastName
SELECT LastName , COUNT(*)
FROM Person.Person
WHERE LastName IN ('Diaz' , 'Hernandez')
GROUP BY LastName
ORDER BY COUNT(*)
沒有留言:
張貼留言