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

2004-02-07 Thread Svensson, B.A.T. (HKG)
You can't posssible have run /my/ script and not get it working, unless you done a copy error. The query you list below is fualty and wont work as specified. -Original Message- From: Herhuth, Ron To: Svensson, B.A.T. (HKG); [EMAIL PROTECTED] Sent: 2004-02-06 15:12 Subject: RE: [PHP-WIN]

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 (a int , b char(1)) create

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 doesn't

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

2004-02-06 Thread Luis Moreira
Not quite true. From the manuals : The LIMIT clause can be used to constrain the number of rows returned by the SELECT statement. LIMIT takes one or two numeric arguments. If two arguments are given, the first specifies the offset of the first row to return, the second specifies the maximum

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

2004-02-06 Thread George Pitcher
I have both access and MySQL DBs and I have to change my method for Access to 'select top 10 [fields] from table where x=x etc order by y' MS SQLServer may need the same. George in Oxford -Original Message- From: Nadim Attari [mailto:[EMAIL PROTECTED] Sent: 6 February 2004 11:33 am

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

2004-02-06 Thread David Felton
No it doesn't. you'll need to do something like this in MS-SQL (using a sub-select): SELECT TOP 10 dbo.Table_MIS_Files.File_ID FROMdbo.Table_MIS_Files WHERE dbo.Table_MIS_Files.File_ID NOT IN (SELECT TOP 25 dbo.Table_MIS_Files.File_ID FROMdbo.Table_MIS_Files)

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 FROM

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

2004-02-06 Thread Herhuth, Ron
Okay I tried this and while it doesn't error out I still only get the first 10 records, if I change the first number I get the number of records that I changed the number to. If I change the second number nothing happens. SELECT TOP 10 dbo.individual.id, last_name, first_name FROM

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