# [EMAIL PROTECTED] / 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

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

               http://archives.postgresql.org

Reply via email to