Re: [PHP-DB] LIMIT problem MSSQL

2003-02-20 Thread Matt Rogish
Also, since Sybase ASE uses a lot of the same T-SQL constructs, you can attempt some methods located here: http://www.isug.com/Sybase_FAQ/ASE/section6.2.html#6.2.12 -- Matt Noam Giladi [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... a solution offered i received

RE: [PHP-DB] LIMIT problem MSSQL

2003-02-19 Thread Snijders, Mark
$start = 10; $numbers_to_show = 25; $sql = SELECT * FROM bla Limit $start, $numbers_to_show; or just go to mysql.com and use the manual :) -Original Message- From: Noam Giladi [mailto:[EMAIL PROTECTED]] Sent: woensdag 19 februari 2003 16:00 To: [EMAIL PROTECTED] Subject: [PHP-DB] LIMIT

Re: [PHP-DB] LIMIT problem MSSQL

2003-02-19 Thread John Krewson
The title suggests MSSQL, which if I am correct doesn't support Limit like MySQL. I'm working on the same thing right now so I don't have a quick and dirty working example, although it doesn't look to be too difficult to use server side cursors in MSSQL. Here is a related a link to a similar

Re: [PHP-DB] LIMIT problem MSSQL

2003-02-19 Thread Noam Giladi
i assume this problem was solved in the past i didn't found a ready solution. i try to use FATCH . and i have another link with ths same problem.. http://forums.devshed.com/showthread.php?threadid=33114 tnx noam John Krewson [EMAIL PROTECTED] wrote in message [EMAIL

Re: [PHP-DB] LIMIT problem MSSQL

2003-02-19 Thread Adam Voigt
Assuming your sorting by id, just do: SELECT TOP 50 * FROM TABLE WHERE id $lastid And just have lastid posting to the page every time they hit next, and in lastid, put the last id of the results on that page. On Wed, 2003-02-19 at 09:59, Noam Giladi wrote: I'm trying to

Re: [PHP-DB] LIMIT problem MSSQL

2003-02-19 Thread Noam Giladi
i'm not using a fixed sort tnx noam Adam Voigt [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Assuming your sorting by id, just do: SELECT TOP 50 * FROM TABLE WHERE id $lastid And just have lastid posting to the page every time they hit next, and

Re: [PHP-DB] LIMIT problem MSSQL

2003-02-19 Thread Adam Voigt
Well if you do, (sort by id) this will work. On Wed, 2003-02-19 at 11:14, Noam Giladi wrote: i'm not using a fixed sort tnx noam Adam Voigt [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Assuming your sorting by id, just do:

Re: [PHP-DB] LIMIT problem MSSQL

2003-02-19 Thread Noam Giladi
a solution offered i received from raydan Untested: Untested: declare @num int set @num = 20 EXEC ('select top 10 from myTable where ID not in (select top ' + @num + ' from myTable order by ID) order by ID') But beware the dangers of dynamic SQL. Mark Snijders [EMAIL PROTECTED] wrote