MySql Query to return number of photos in each album
Posted
by
GivenPie
on Stack Overflow
See other posts from Stack Overflow
or by GivenPie
Published on 2012-12-10T05:01:36Z
Indexed on
2012/12/10
5:03 UTC
Read the original article
Hit count: 142
MY table is set up like this, all I need to do is call a query to my Photos table.
I have PhotoID as the primary key and GalleryID as the foreign key to Gallery. How can I could the number of unique PhotoID's for each multiple GalleryIDs.
So to speak there are may duplicate GalleryIDs because there are many photos in a gallery. So I just need to could the number of unique PhotoIDs associated with that GalleryID.
Can it be done in one query?
© Stack Overflow or respective owner