Is there no way at all to invert the value of a section? I understand that I could "multiply it out", but that would nearly impossible because this is generated automatically from any possible input including multiple levels:
Search input: "a OR -(b -(c d OR -e)))"
To create a dynamic system capable of multiplying out the negation, that would require tracking layers of parentheticals, multiple levels of negation and other factors. It's possible, but while I was thinking through how hard it would be, I decided it's best to find some other way because it's so hard...
Is there some reason mysql can't do a higher-order negation? Is this part of its efficiency/processing?
I really have no idea how mysql works at a technical level, so perhaps I'm missing something.
---
traq, no, I have not done much experimenting yet. I thought it would be best to ask first because mysql confuses me especially with complex queries. I can handle all the normal single-level queries, but once it gets like this I wanted to check a few things first.
Code:
WHERE (`a` LIKE '%b%' (NOT (`a` LIKE '%c%')))
Is this valid syntax? My parser is already generating this (from 'b -(c)').
Actually, it would generate:
Code:
WHERE `a` LIKE '%b%' AND NOT (`a` LIKE '%c%')
I could adjust the syntax slightly if the extra parentheses help or something.
---
In short, I just need to know if "NOT" can act as a standalone operator negating what's inside a parenthetical section.
Is that valid within a where statement?
I have been searching google, but I can't find any reference to NOT as a standalone operator. It's only referenced within constructs such as "NOT LIKE" and "NOT EXISTS" etc.
Here's the most "useful" page I've found, but it's not clear at all:
http://dev.mysql.com/doc/refman/5.1/...l#operator_not
Bookmarks