I have this assets table:
asset_id | mediumint(8)
asset_type_id | mediumint(8)
asset_name | varchar(200)
and a lookup table:
product_id | mediumint(8)
asset_id | mediumint(8)
sequence | smallint(3)
Basically, the lookup table can have multiple entries of assets for an item. And you can get the item description in assets table.
The assets is categorized as an image, video, sound, etc based on its asset_type_id. This asset_type_id is comprises of integers 1 to 16.
Now, I want to count the number of images(1), video(2) and sound(3) ONLY for a particular item. Is there anyway I can do this using one SELECT QUERY?
I can't limit my selection to just asset_type_id = 1 or 2 or 3 because I still need the other assets data.