Why don't you just use a position cursor?
Do you get a performance hit if you do it?
-Original Message-
From: Herhuth, Ron
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]; Herhuth, Ron
Sent: 2004-02-06 18:05
Subject: RE: [PHP-WIN] SQL to select a set of records
It do
That's why I added the "drop table ..." in the end, smart ass. ;) =)
-Original Message-
From: Frank M. Kromann
To: Svensson, B.A.T. (HKG)
Cc: '[EMAIL PROTECTED]'
Sent: 2004-02-06 17:15
Subject: RE: [PHP-WIN] SQL to select a set of records
create table #test (
values (24, 'e')
>insert into test values (25, 'e')
>insert into test values (26, 'e')
>insert into test values (27, 'e')
>insert into test values (28, 'e')
>insert into test values (29, 'e')
>insert into test values (
EMAIL PROTECTED]
>Sent: 06 February 2004 12:45
>To: David Felton
>Cc: Nadim Attari; [EMAIL PROTECTED]; Herhuth, Ron
>Subject: Re: [PHP-WIN] SQL to select a set of records
>
>
>David Felton wrote:
>> SELECT TOP 10 dbo.Table_MIS_Files.File_ID
>> FROM dbo.Tabl
No. What I said was correct, as Ron wanted rows 25-35.
-Original Message-
From: Stuart [mailto:[EMAIL PROTECTED]
Sent: 06 February 2004 12:45
To: David Felton
Cc: Nadim Attari; [EMAIL PROTECTED]; Herhuth, Ron
Subject: Re: [PHP-WIN] SQL to select a set of records
David Felton wrote
ert into test_tmp
> select top 25 *
> from test
> order by a asc
>
> select *
> from test_tmp
> where a in(
>select top 15 a
>from test_tmp
>order by a desc
> )
> order by a asc
>
> drop table test_tmp
> drop table test
>
&
nsert into test values (25, 'e')
>insert into test values (26, 'e')
>insert into test values (27, 'e')
>insert into test values (28, 'e')
>insert into test values (29, 'e')
>insert into test values (30, 'e')
>
>insert
insert into test values (26, 'e')
insert into test values (27, 'e')
insert into test values (28, 'e')
insert into test values (29, 'e')
insert into test values (30, 'e')
insert into test_tmp
select top 25 *
from test
order by a asc
select *
from
David Felton wrote:
SELECT TOP 10 dbo.Table_MIS_Files.File_ID
FROM dbo.Table_MIS_Files
WHERE dbo.Table_MIS_Files.File_ID NOT IN
(SELECT TOP 25 dbo.Table_MIS_Files.File_ID
FROM dbo.Table_MIS_Files)
Shouldn't this be...
SELECT TOP 25 dbo.Table_MIS_Files.File_ID
FROMdbo.Table_MIS_F
_MIS_Files)
-Original Message-
From: Nadim Attari [mailto:[EMAIL PROTECTED]
Sent: 06 February 2004 11:33
To: [EMAIL PROTECTED]
Subject: Re: [PHP-WIN] SQL to select a set of records
> mysql> select * from table LIMIT 5,10; # Retrieve rows 6-15
> If one argument is given, it indicates th
February 2004 11:33 am
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP-WIN] SQL to select a set of records
>
>
> > mysql> select * from table LIMIT 5,10; # Retrieve rows 6-15
>
> > If one argument is given, it indicates the maximum number of rows to
> return:
> >
> mysql> select * from table LIMIT 5,10; # Retrieve rows 6-15
> If one argument is given, it indicates the maximum number of rows to
return:
> mysql> select * from table LIMIT 5; # Retrieve first 5 rows
Dunno whether LIMIT works in Microsoft SQL Server ... someone may check it
plzzz
~nadim
l Message -
From: "Svensson, B.A.T. (HKG)" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, February 05, 2004 9:57 PM
Subject: RE: [PHP-WIN] SQL to select a set of records
> You can for instance insert the top 35 into a tmp table, then delete the
top
> 10
You can for instance insert the top 35 into a tmp table, then delete the top
10 with from-from in the temp table, and then finaly select the rest.
Alternative you can select top with decending order form the temp table, but
this depends on if you have an ordered set or not of course.
Another poss
14 matches
Mail list logo