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 2005 Forums
 Other SQL Server Topics (2005)
 select by group

Author  Topic 

wided
Posting Yak Master

218 Posts

Posted - 2010-10-19 : 11:44:53
I have a list of employees (exemple: 100 records)

i want to select employees like this:

20 records

then
20 records next

then 20 record next
.....


can i have this result with select?
how to write this query
thanks

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-10-19 : 12:09:44
I think you should search for paging to find info like this:
http://www.aspfaqs.com/webtech/062899-1.shtml

If that isn't what you mean then be more specific please.


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

wided
Posting Yak Master

218 Posts

Posted - 2010-10-19 : 12:22:42
yes

if i have a table like this

col1 col2
001 A
002 B
003 C
004 D
005 E
006 F
007 G
008 H
009 I
010 J

I whant to have a result 2 by 2
001 A
002 B

THEN
003 C
004 D

THEN
005 E
006 F

THEN
007 G
008 H

...
...

IT IS STUPID?
But i need this
thanks webfred


Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-10-19 : 14:10:40
where do you want to show this data? in some report?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

wided
Posting Yak Master

218 Posts

Posted - 2010-10-20 : 03:41:01

yes, in some report

thanks
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-10-20 : 13:14:49
then you can even do pagination there

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -