find the number of rows for each table
От | Patrick Coulombe |
---|---|
Тема | find the number of rows for each table |
Дата | |
Msg-id | 20000615.20103600@modemcable079.96-200-24.mtl.mc.videotron.net обсуждение исходный текст |
Ответы |
Re: find the number of rows for each table
|
Список | pgsql-sql |
Hi, I want to find the number of rows for each table (2) in 1 query, the query is: select distinct * from medias, contacts WHERE medias.media_id = contacts.media_id AND medias_categories.media_id = medias.media_id AND medias_categories.categorie_id = 1 -------- 700 rows If I want to find the number of row for medias (for the same query) I have to do a other query : select distinct * from medias WHERE medias.media_id = contacts.media_id AND medias_categories.media_id = medias.media_id AND medias_categories.categorie_id = 1 -------- 60 rows I search for a solution, I try that : select distinct *, count(distinct (medias.media_id)), count(distinct (contacts.contact_id)) from medias, contacts WHERE medias.media_id = contacts.media_id AND medias_categories.media_id = medias.media_id AND medias_categories.categorie_id = 1 ------------------------------------------------- ERROR: parser: parse error at or near "distinct" don't work, as you can see. I need help, please. Patrick
В списке pgsql-sql по дате отправления: