| От | Jean-Christian Imbeault |
|---|---|
| Тема | count() for a select statement? |
| Дата | |
| Msg-id | 3D99DF6E.6090009@mega-bucks.co.jp обсуждение исходный текст |
| Ответы |
Re: count() for a select statement?
Re: count() for a select statement? |
| Список | pgsql-general |
Is there an efficient way to get a count of the number of rows returned by this kind of query? select id from products where name ILIKE 'TNT' UNION select id from products where name ILIKE 'ATOM' UNION select id from products where name ILIKE 'BOB' I don't need any of the data returned, just a row count. The way I do it now is to execute the query and use (in PHP) pg_numrows() on the result set. But that mean the whole result set is being sent back to me when all I need is a count ... I've tried select count( select id from ...) but that didn't work ;) Jc
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера