In my website, I have a product image display region. When a user click on a product, it will redirect to the image display page. I had set a default image. Which will display when user see the product. But when the user go to the product image page, I don't want to show the default image, if there exist more than one image. But I need to show the default image if there exist only one image in the database. Currently I am doing this with two queries. Is there any way to do this with a single query?
I need something like
select image from table where if exists more than 1 then select 'non-featured' else select 'featured'
Please help