|
Home > Archive > PostgreSQL SQL > November 2006 > Select (1-3)
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
| Ezequias Rodrigues da Rocha 2006-11-30, 7:20 pm |
| Hi list,
It is possible to make a selection like
Select (list 1 to 1000);
And get the rows ?
producao=# select ...;
row
---------
1
2
3
..
..
..
1000
----------
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Atenciosamente (Sincerely)
Ezequias Rodrigues da Rocha
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
A pior das democracias ainda é melhor do que a melhor das ditaduras
The worst of democracies is still better than the better of dictatorships
http://ezequiasrocha.blogspot.com/
---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend
| |
| Alvaro Herrera 2006-11-30, 7:20 pm |
| Ezequias Rodrigues da Rocha wrote:
> Hi list,
>
> It is possible to make a selection like
>
> Select (list 1 to 1000);
Sure, use the generate_series() function.
select * from generate_series(1, 1000);
--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support
---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?
http://archives.postgresql.org
| |
| Aaron Bono 2006-11-30, 7:20 pm |
| On 11/30/06, Ezequias Rodrigues da Rocha <ezequias.rocha@gmail.com> wrote:
>
> Hi list,
>
> It is possible to make a selection like
>
> Select (list 1 to 1000);
>
> And get the rows ?
>
> producao=# select ...;
> row
> ---------
> 1
> 2
> 3
> .
> .
> .
> 1000
>
*select * from generate_series(1, 1000);*
See
http://oreillynet.com/pub/a/databas...tes.html?page=2
--
====================
====================
====================
======
Aaron Bono
Aranya Software Technologies, Inc.
http://www.aranya.com
http://codeelixir.com
====================
====================
====================
======
| |
| Ezequias Rodrigues da Rocha 2006-11-30, 7:20 pm |
| Uow !
1 to one m
select * from generate_series(1, 1000000);
In 5203 miliseconds (that's a great performmance). My server is not
quite good but the performance was great for me.
Thank you so much
Ezequias
2006/11/30, Aaron Bono <postgresql@aranya.com>:
> On 11/30/06, Ezequias Rodrigues da Rocha <ezequias.rocha@gmail.com> wrote:
>
> select * from generate_series(1, 1000);
>
> See
> http://oreillynet.com/pub/a/databas...tes.html?page=2
>
> --
> ====================
====================
====================
======
> Aaron Bono
> Aranya Software Technologies, Inc.
> http://www.aranya.com
> http://codeelixir.com
> ====================
====================
====================
======
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Atenciosamente (Sincerely)
Ezequias Rodrigues da Rocha
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
A pior das democracias ainda é melhor do que a melhor das ditaduras
The worst of democracies is still better than the better of dictatorships
http://ezequiasrocha.blogspot.com/
---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend
|
|
|
|
|