Home All Groups Group Topic Archive Search About

Chunk of rows in without using FETCH NEXT.

Author
1 Sep 2006 3:19 AM
Vilma
Hi all.

I am looking for a way to get small chunks of rows (pages) with another sort
order than the primary key, in this case a date. I have got a table like
this.I would prefer not to use cursors.

Can youl pull oun the while table with a sort, identifiy the primkey and get
the next 3 rows? Or is that using cursors??

Identifier (INT, Primary key)
Processed (DateTime)

Identifier    Processed
1                20060404
2                20060505
3                20060101
4                20061010
5                20060101
6                20061212
7                etc
8                etc
9                etc
10              etc

Cheers

Vilma

Author
1 Sep 2006 3:29 AM
Uri Dimant
Vilma

I'm not sure that understood you , if it  is not what you wanted , please
let me know

create table #test (c int , dt datetime)

insert into #test values (1,'20060901')
insert into #test values (2,'20060902')
insert into #test values (3,'20060903')
insert into #test values (4,'20060904')
insert into #test values (5,'20060905')
insert into #test values (6,'20060906')

select * from #test

insert into #test select max(c)+1, max(dt)+1 from #test

select * from #test








Show quote
"Vilma" <vi***@hotmail.com> wrote in message
news:u3%23tpVXzGHA.3656@TK2MSFTNGP04.phx.gbl...
> Hi all.
>
> I am looking for a way to get small chunks of rows (pages) with another
> sort order than the primary key, in this case a date. I have got a table
> like this.I would prefer not to use cursors.
>
> Can youl pull oun the while table with a sort, identifiy the primkey and
> get the next 3 rows? Or is that using cursors??
>
> Identifier (INT, Primary key)
> Processed (DateTime)
>
> Identifier    Processed
> 1                20060404
> 2                20060505
> 3                20060101
> 4                20061010
> 5                20060101
> 6                20061212
> 7                etc
> 8                etc
> 9                etc
> 10              etc
>
> Cheers
>
> Vilma
>
Author
1 Sep 2006 3:43 AM
Vilma
Thanks Uri.

My english was not to well. Found out looking through the question. Have
been up all night, so I will let you know tomorrow.

Cheers
Vilma

Show quote
"Uri Dimant" <u***@iscar.co.il> wrote in message
news:e5WWkaXzGHA.4176@TK2MSFTNGP06.phx.gbl...
> Vilma
>
> I'm not sure that understood you , if it  is not what you wanted , please
> let me know
>
> create table #test (c int , dt datetime)
>
> insert into #test values (1,'20060901')
> insert into #test values (2,'20060902')
> insert into #test values (3,'20060903')
> insert into #test values (4,'20060904')
> insert into #test values (5,'20060905')
> insert into #test values (6,'20060906')
>
> select * from #test
>
> insert into #test select max(c)+1, max(dt)+1 from #test
>
> select * from #test
>
>
>
>
>
>
>
>
> "Vilma" <vi***@hotmail.com> wrote in message
> news:u3%23tpVXzGHA.3656@TK2MSFTNGP04.phx.gbl...
>> Hi all.
>>
>> I am looking for a way to get small chunks of rows (pages) with another
>> sort order than the primary key, in this case a date. I have got a table
>> like this.I would prefer not to use cursors.
>>
>> Can youl pull oun the while table with a sort, identifiy the primkey and
>> get the next 3 rows? Or is that using cursors??
>>
>> Identifier (INT, Primary key)
>> Processed (DateTime)
>>
>> Identifier    Processed
>> 1                20060404
>> 2                20060505
>> 3                20060101
>> 4                20061010
>> 5                20060101
>> 6                20061212
>> 7                etc
>> 8                etc
>> 9                etc
>> 10              etc
>>
>> Cheers
>>
>> Vilma
>>
>
>
Author
1 Sep 2006 5:28 AM
Arnie Rowland
I'm not too sure I understand your question, but perhaps this article will
help -as best as I can tell.

www.aspfaq.com/2120

--
Arnie Rowland, Ph.D.
Westwood Consulting, Inc

Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous


Show quote
"Vilma" <vi***@hotmail.com> wrote in message
news:u3%23tpVXzGHA.3656@TK2MSFTNGP04.phx.gbl...
> Hi all.
>
> I am looking for a way to get small chunks of rows (pages) with another
> sort order than the primary key, in this case a date. I have got a table
> like this.I would prefer not to use cursors.
>
> Can youl pull oun the while table with a sort, identifiy the primkey and
> get the next 3 rows? Or is that using cursors??
>
> Identifier (INT, Primary key)
> Processed (DateTime)
>
> Identifier    Processed
> 1                20060404
> 2                20060505
> 3                20060101
> 4                20061010
> 5                20060101
> 6                20061212
> 7                etc
> 8                etc
> 9                etc
> 10              etc
>
> Cheers
>
> Vilma
>

AddThis Social Bookmark Button