List:General Discussion« Previous MessageNext Message »
From:Gerald Clark Date:June 6 2002 1:46pm
Subject:Re: Is it possibile to have something similar?
View as plain text  
No you can't, but check out LIMIT.

Marco Stagno wrote:

>>IMHO, The Right Thing to do this, is to create the additional data in
>>your application (as you said you won't change the table).
>>
>
>(...)
>
>thank you! 
>
>>If you want this with SQL for sure, using user-defined variables will
>>work:
>>
>
>cool. sorry, but I'm still learning, since I'm into MySQL from a few time
>only!
>
>>mysql> select @a := @a + 1 AS pos, gid from config where gid>300000 limit
> 10;
>>+------+--------+
>>| pos  | gid    |
>>+------+--------+
>>|    1 | 300001 |
>>|    2 | 300002 |
>>|    3 | 300003 |
>>
>
>...can I use the "pos" data in a "WHERE" statment?
>
>something like..
>
>select @a := @a + 1 AS pos, gid from config where pos > 100 and pos <200 ?
>
>(or there is a better way to have a particular subset of data WITHOUT
>HAVING ANY INFO ON THE DB STRUCTURE?! I'm trying to have a tool to paging
>the query result in a gui structure)
>
>>Another approach would be to select the data into a TEMPORARY TABLE.
>>
>
>how can I do that?
>
>thank you very much again!
>
>bye bye!
>
>                                  MAS!
>
>
>---------------------------------------------------------------------
>Before posting, please check:
>   http://www.mysql.com/manual.php   (the manual)
>   http://lists.mysql.com/           (the list archive)
>
>To request this thread, e-mail <mysql-thread111135@stripped>
>To unsubscribe, e-mail
> <mysql-unsubscribe-gerald_clark=suppliersystems.com@stripped>
>Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>
>


Thread
Is it possibile to have something similar?Marco Stagno5 Jun
  • Re: Is it possibile to have something similar?Keith C. Ivey5 Jun
    • Re: Is it possibile to have something similar?Marco Stagno6 Jun
  • Re: Is it possibile to have something similar?Benjamin Pflugmann5 Jun
    • Re: Is it possibile to have something similar?Marco Stagno6 Jun
  • Re: Is it possibile to have something similar?Gerald Clark6 Jun
    • Re: Is it possibile to have something similar?Marco Stagno6 Jun