I have the following query:
SELECT TOP (100) PERCENT
FROM view_photos_info_including_cat_info AS vp
INNER JOIN view_photos_main_cats AS vmc ON vmc.cat_id = vp.pc_parent_cat_id
ORDER BY vp.photo_id, vmc.pc_importance
This produce a list that will have multiple entries for photo_id. Everything is the same but the pc_title is different. In other words each photo now exists in in multiple categories (pc_title).
What I need is unique entries by photo_id.
For example, above would need to become:
I just cannot figure out the proper method to get this done.