Re: SQL query question
| От | Roman Neuhauser | 
|---|---|
| Тема | Re: SQL query question | 
| Дата | |
| Msg-id | 20050203123754.GA10688@isis.wad.cz обсуждение исходный текст | 
| Ответ на | SQL query question ("Uwe C. Schroeder" <uwe@oss4u.com>) | 
| Список | pgsql-general | 
# uwe@oss4u.com / 2005-02-02 23:32:28 -0800:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
>
> Maybe it's to late for me to think correctly (actually I'm sure of
> that). I'm going to ask anyways.  I have a table like
>
> id int4
> user_id int4
> photo varchar
> image_type char(1)
>
> where image_type is either G or X
> What I want to do is have ONE query that gives me the count of images
> of each type per user_id.
> So if user 3 has 5 photos of type G and 3 photos of type X
> I basically want to have a result 5,3
    SELECT COUNT(*) FROM t GROUP BY t.user_id, t.image_type
--
If you cc me or remove the list(s) completely I'll most likely ignore
your message.    see http://www.eyrie.org./~eagle/faqs/questions.html
		
	В списке pgsql-general по дате отправления: