Re: OT: Limit en Sql Server
| From: | Pablo E. Siciliano | Date: | Tue, 28 Oct 2003 12:28:47 +0000 |
| Subject: | Re: OT: Limit en Sql Server | ||
| References: | 1 2 3 | Groups: | php.general.es |
| Request: | Send a blank email to general-es+get-41955@lists.php.net to get a copy of this message | ||
Deberías ordenarlos por id ascendente(O descendente) pasarle el último id a
la próxima página, y traerte los n registros mayores (O menores, si es orden
descendente).
Algo así como SELECT TOP 100 * FROM TABLA WHERE id>$ultimo_id
De todos modos, si es mas prolijo que uses un objeto que te permita
abstraerte de la base de datos, como ya te dijeron (Y, como ya te dijeron,
en el histórico hay abundantes mails sobre este tema)
----- Original Message -----
From: "Federico Garcia" <fgarcia@psycompany.com>
To: <lista@phpes.com>
Sent: Monday, October 27, 2003 7:40 PM
Subject: Re: [PHP-ES] OT: Limit en Sql Server
> Si eso es perfecto para los primeros o para los ultimos 100 pero si quiero
> usarlo para un pagindor, como hago para traer los del medio
>
> ----- Original Message -----
> From: "Ronald Castillo" <rcastillo@cultural.edu.pe>
> To: <lista@phpes.com>; "Federico Garcia" <fgarcia@psycompany.com>
> Sent: Monday, October 27, 2003 7:32 PM
> Subject: Re: [PHP-ES] OT: Limit en Sql Server
>
>
> > PRUEBA CON
> > SELECT TOP 100 * FROM TABLA
> > *************************************
> > Ronald Castillo Portocarrero
> > Desarrollo de Software
> > CCPNA - Arequipa
> > 54 891020 - 54 9932323
> > ----- Original Message -----
> > From: "Federico Garcia" <fgarcia@psycompany.com>
> > To: <lista@phpes.com>
> > Sent: Monday, October 27, 2003 4:39 PM
> > Subject: [PHP-ES] OT: Limit en Sql Server
> >
> >
> > Hola a todos quiero hacer
> > Select * FROM tabla limit 0,100
> >
> > Pero en Sql Server no anda el limit.
> > Como puedo hacer gracias
> >
> > ---------------------------------------------------------------------
> > Archivo On-line: http://www.phpes.com/
> > via news: news://news.phpes.com/
> > Manual PHP en español: http://www.php.net/manual/es/
> > Para dar de baja la suscripción, mande un mensaje a:
> > lista-unsubscribe@phpes.com
>
>
> ---------------------------------------------------------------------
> Archivo On-line: http://www.phpes.com/
> via news: news://news.phpes.com/
> Manual PHP en español: http://www.php.net/manual/es/
> Para dar de baja la suscripción, mande un mensaje a:
> lista-unsubscribe@phpes.com
>
>
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.532 / Virus Database: 326 - Release Date: 27/10/03