DECLARE @TEST TABLE(
ID int, Amount int)
INSERT INTO @TEST VALUES
(1,10),(2,30),(3,60),
(4,50),(5,50),(6,70),
(7,20),(8,70),(9,70),
(10,44),(11,80),(12,90)
select * from @TEST
select Top 3 ID, Amount from @TEST ORDER BY Amount desc
select Top 3 With TIES ID, Amount from @TEST ORDER BY Amount desc
select Top 3 PERCENT ID, Amount from @TEST ORDER BY Amount desc
No comments:
Post a Comment