0

If I have a simple query below as

select ID, sum(amount)
from table
where sum(amount) > 200
group by ID
limit 1 

that gives me the ID with the highest total spend

if I am doing same in sql engine that does not except limit, but top how would I replace limit here with top?

Thanks

Logica
  • 977
  • 4
  • 16
Chris90
  • 1,868
  • 5
  • 20
  • 42
  • https://stackoverflow.com/questions/1891789/sql-select-first-10-rows-only/36476971#36476971 – jarlh Feb 19 '20 at 07:35
  • Why not simply read the manual [of that SQL engine](https://learn.microsoft.com/en-us/sql/t-sql/queries/select-clause-transact-sql?view=sql-server-2017) –  Feb 19 '20 at 07:36

0 Answers0