This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Brian, Even without stored procs, you can do multiple queries. I recommend one query to get all the albumn names with the corresponding # of photos and another query to get the featured photo for each album. You could do it in one query, but it would be complex.
This may not be most best solution but it's easy. Since you are using a 1 for featured photo (and i am assuming a 0 for all non-featured) just use an Order By DESC clause to order the photos, the first will be your featured photo, then you can just count the records in the result set by iterating through it. [ April 21, 2006: Message edited by: Brian Smith ]
author & internet detective