i need help with one more sql query.
if i've got 2 columns in a table:
tag1 tag2
and want to select rows that got either $tag1 OR $tag2 but never $tag1 AND $tag2, how could i write the sql query?
i've tried with:
SELECT id
FROM tagPairs
WHERE (tag1 IN ($tag1, $tag2))
OR (tag2 IN ($tag1, $tag2))
AND ((tag1 != $tag1 OR tag1Id != $tag2) AND (tag2 != $tag1 OR tag2 != $tag2))
but it doesnt seem to work.
would appreciate some help here, thanks!