Re: Rows in tables...

Поиск
Список
Период
Сортировка
От Dan Wilson
Тема Re: Rows in tables...
Дата
Msg-id 02c001c09ac6$6790d140$078353d8@danwilson
обсуждение исходный текст
Ответ на Rows in tables...  (Herb Pabst <herbie@nextearth.com>)
Список pgsql-php
You may be looking for a query like this:

SELECT * FROM [table] ORDER BY random() LIMIT 1

This will automtically select a random row and only return 1 tuple.  This
will cut down on your query time and the memory usage.

I don't know if that was what you are trying to do.

-Dan


> What is the easiest way to get the total number of
> rows in a table? I want to do a random pick from a
> table and need to know how many rows are in the
> table.
>
> Do I do a "SELECT * FROM table" and use the info
> from this, or will a select return all the data?
> This is where I'm hazy. Or does fetch_row actually
> return the data?
>
> Any help is appreciated,
> Herbie Pabst
>


В списке pgsql-php по дате отправления:

Предыдущее
От: "Mitch Vincent"
Дата:
Сообщение: Re: Rows in tables...
Следующее
От: rno
Дата:
Сообщение: authentification / news script