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
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Help for a Query

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2005-08-30 : 07:59:46
Praveen Kumar writes "I have a table look like below

id name
--- --------
1 joi
2 joi
3 joi
4 kevin
5 kevin
6 kevin
7 kevin


if i use a value 2 in the query, i need to get the
table look like below

id name
---- -------
1 joi
2 joi
4 kevin
5 kevin


please help me to write a query for the above question "

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-08-30 : 08:04:19
Refer Point 2 here
http://weblogs.sqlteam.com/mladenp/archive/2005/08/01/7421.aspx

Madhivanan

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

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2005-08-30 : 08:54:32
you need to explain your logic as well -- your results don't make much sense just by looking at them.
Go to Top of Page

AndrewMurphy
Master Smack Fu Yak Hacker

2916 Posts

Posted - 2005-08-30 : 09:02:51
"you need to explain your logic as well -- your results don't make much sense just by looking at them."...top 2 from each group (by name)???
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-08-30 : 09:04:47
quote:
Originally posted by AndrewMurphy

"you need to explain your logic as well -- your results don't make much sense just by looking at them."...top 2 from each group (by name)???


Yes. It is

Madhivanan

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

- Advertisement -