supposed I have a table with three columns: user_to, user_from, counter. I’m trying to do a query that checks does a cross reference check from the same table. Maybe this will help understand:
SELECT user_to AS user_to1
, user_from AS user_to2
FROM tbl
WHERE counter > 10
AND NOT EXISTS (
SELECT *
FROM tbl
WHERE user_to = user_from1
AND user_from = user_to1
)
I assume I’m trying to do it wrong, but the query helps to understand what I’m trying to accomplish.
you can add an
ALIASon it,