RE: [PHP-WIN] SQL to select a set of records

2004-02-07 Thread Svensson, B.A.T. (HKG)
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

RE: [PHP-WIN] SQL to select a set of records

2004-02-07 Thread Svensson, B.A.T. (HKG)
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 (

RE: [PHP-WIN] SQL to select a set of records

2004-02-07 Thread Svensson, B.A.T. (HKG)
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 (

RE: [PHP-WIN] SQL to select a set of records

2004-02-06 Thread Herhuth, Ron
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

RE: [PHP-WIN] SQL to select a set of records

2004-02-06 Thread David Felton
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

RE: [PHP-WIN] SQL to select a set of records

2004-02-06 Thread Frank M. Kromann
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 > &

RE: [PHP-WIN] SQL to select a set of records

2004-02-06 Thread Herhuth, Ron
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

RE: [PHP-WIN] SQL to select a set of records

2004-02-06 Thread Svensson, B.A.T. (HKG)
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

Re: [PHP-WIN] SQL to select a set of records

2004-02-06 Thread Stuart
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

RE: [PHP-WIN] SQL to select a set of records

2004-02-06 Thread David Felton
_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

RE: [PHP-WIN] SQL to select a set of records

2004-02-06 Thread George Pitcher
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: > >

Re: [PHP-WIN] SQL to select a set of records

2004-02-06 Thread Nadim Attari
> 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

Re: [PHP-WIN] SQL to select a set of records

2004-02-06 Thread Luis Moreira
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

RE: [PHP-WIN] SQL to select a set of records

2004-02-05 Thread Svensson, B.A.T. (HKG)
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