By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,856 Members | 2,179 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,856 IT Pros & Developers. It's quick & easy.

dividing return set into smaller sets

P: n/a
Hi,

I have a problem with t-sql query.

Let's assume, that i have a query

selest * from table01

which return a dataset:

| Colum1 | Column2
-------------------------------------
R1| A | B
R2| C | D
R3| E | F
R4| G | H

but I need return few dataset (as many as rows), as shown:

| Colum1 | Column2
-------------------------------------
R1| A | B

| Colum1 | Column2
-------------------------------------
R2| C | D

| Colum1 | Column2
-------------------------------------
R3| E | F

etc....

and I can not use cursors.

Do you have any idea how to solve this? I appreciate any suggestion.

Thank you very much in advance,

Christopher
Sep 15 '08 #1
Share this Question
Share on Google+
1 Reply


P: n/a
(kr******@wp.pl) writes:
I have a problem with t-sql query.

Let's assume, that i have a query

selest * from table01

which return a dataset:

| Colum1 | Column2
-------------------------------------
R1| A | B
R2| C | D
R3| E | F
R4| G | H

but I need return few dataset (as many as rows), as shown:

| Colum1 | Column2
-------------------------------------
R1| A | B

| Colum1 | Column2
-------------------------------------
R2| C | D

| Colum1 | Column2
-------------------------------------
R3| E | F

etc....

and I can not use cursors.

Do you have any idea how to solve this? I appreciate any suggestion.
I would suggest that you give the full story about why you feel compelled
to ask for this. Then maybe we can find a better solution to your underlying
problem. To wit, this is such a funny request, that all answers will also be
funny, so there is all reason to look for a better solution.
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Sep 15 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.