Magentix
if (OP.statement == false) postCount++;
- Reaction score
- 107
I just had a hard time figuring this SQL commando out and it might prove useful for others that encounter the problem in the future...
What it does:
Take unique values from fieldName of tableOne that don't exist in fieldName of tableTwo
Sounds simple eh? Well check this out:
If you can use it: enjoy!
Otherwise: Don't be mad that I just stole 20 seconds of your life...
What it does:
Take unique values from fieldName of tableOne that don't exist in fieldName of tableTwo
Sounds simple eh? Well check this out:
Code:
SELECT tableUnion.fieldName AS unionFieldName FROM(
SELECT DISTINCT fieldName FROM tableOne
UNION ALL
SELECT y.fieldName FROM tableTwo AS y
INNER JOIN tableOne AS x
ON y.fieldName =x.fieldName
) AS tableUnion
GROUP BY unionFieldName
HAVING ( COUNT(unionFieldName )=1 )
If you can use it: enjoy!
Otherwise: Don't be mad that I just stole 20 seconds of your life...