Well, I managed to create FQL for this problem, but itβs not at all.
SELECT object_id, pid, src_big FROM photo WHERE pid IN (SELECT pid FROM photo_tag WHERE pid IN (SELECT pid FROM photo_tag WHERE subject = me()) AND NOT (pid IN (SELECT pid FROM photo_tag WHERE pid IN (SELECT pid FROM photo_tag WHERE subject = me()) AND subject != me()) ) )
Explanation:
The first one is pretty simple, get the current user's photo_tags
SELECT pid FROM photo_tag WHERE subject = me()
The next one I joined the same table, but this time I need pictures where I was with someone
SELECT pid FROM photo_tag WHERE pid IN (SELECT pid FROM photo_tag WHERE subject = me()) AND subject != me()
I joined the same table again (yes 3 connects to one table), but this time I wanted photo_tags, where I was the subject And , which were not in the list that I got earlier (photos where I was the subject of someone ), so this query returns all photo_tags where the user is the only one tagged in this photo.
SELECT pid FROM photo_tag WHERE pid IN (SELECT pid FROM photo_tag WHERE subject = me()) AND NOT (pid IN (SELECT pid FROM photo_tag WHERE pid IN (SELECT pid FROM photo_tag WHERE subject = me()) AND subject != me()) )
The last addition to the request was just a union to get information from the table of photos in the photographs, I was the only one marked
SELECT object_id, pid, src_big FROM photo WHERE pid IN (SELECT pid FROM photo_tag WHERE pid IN (SELECT pid FROM photo_tag WHERE subject = me()) AND NOT (pid IN (SELECT pid FROM photo_tag WHERE pid IN (SELECT pid FROM photo_tag WHERE subject = me()) AND subject != me()) ) )