Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 how to select the biggest five values from table

Author  Topic 

leoparsd
Starting Member

6 Posts

Posted - 2006-12-15 : 05:13:33
as i stated in the subject i want to gather the biggest five records from the table with sql, how can i do that?

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2006-12-15 : 05:15:11
Biggest? in what terms?

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-12-15 : 06:04:59

1 Select top 5 Values from table Order by values DESC
2 Post some sample data and the result you want

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2006-12-15 : 09:09:14
Job interview question?




CODO ERGO SUM
Go to Top of Page

leoparsd
Starting Member

6 Posts

Posted - 2006-12-15 : 11:29:09
thank you so much madhivan , i got that done successfully ; however, no i am troubling with another sql problem.
i gotta calculate the sum of different fields in the table. i thought about using sum aggregate function but as far as i know it just calculates the sum of the same field provided that you group the rows.
thank you inadvance..
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-12-15 : 11:35:14

Can you post some data and the result you want?

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -