| От | tjk@tksoft.com |
|---|---|
| Тема | Re: [SQL] Counting the number of distinct rows returned |
| Дата | |
| Msg-id | 199908190520.WAA20898@uno.tksoft.com обсуждение исходный текст |
| Ответ на | Counting the number of distinct rows returned (Drew Whittle <drew@albatross.co.nz>) |
| Список | pgsql-sql |
Drew, Not really the answer you were asking, but in general, your program will probably be using some interface other than psql, i.e. libpq or Pg.pm, or whatever. E.g. in C, if your PgQuery struct is pg1, then you would do your query and retrieve the number of records found with "pg1->PQntuples(pg1->reply)" Troy > > How can I return the number of records (ie a count(user_id)) when using a > statement like this: > > select distinct user_id from sales_by_region; > > I have tried things like: > > select count(distinct user_id) from sales_by_region (parse error) > select distinct count(user_id) from sales_by_region (useless because count > is performed before the distinct) > > HELP! > > Thanks, > > Drew > > > > ************ > Check out "PostgreSQL Wearables" @ http://www.pgsql.com > >
В списке pgsql-sql по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера