sql >> Database >  >> RDS >> Sqlserver

SQL Select, specifieke rijen op basis van meerdere voorwaarden?

;WITH x AS 
(
  SELECT [Business_Month], ID, Calls, Transferred, Loaded,
    rn = ROW_NUMBER() OVER 
    (PARTITION BY ID, [Business Month] ORDER BY Loaded DESC)
  FROM dbo.yourtable
)
SELECT [Business Month], ID, Calls, Transferred, Loaded
FROM x
WHERE rn = 1
ORDER BY ID, [Business Month];


  1. Hoe jsonb-arrays op te vragen met de IN-operator

  2. TRUNC(getal) Functie in Oracle

  3. Databasebewuste taakverdeling:migreren van HAProxy naar ProxySQL

  4. sessie/entitymanager is gesloten