My experience so far is that the existing search GUI is really comprehensive in all areas except boolean logic - e.g. the stuff at http://en.wikiversity.org/wiki/Primary_ ... lean_logic - grouping with parenthesis, and, or, not, xor, etc.
But I'm sure there are many other searches people would like to do that are not too hard to do in SQL but are impossible with the current search function. Since the current search function is not, you know, an entire mostly-declarative programming language based on branches of algebra and calculus.

One way to do this would be to have "SQL Query" be a new condition type. Since the "Search..." UI expects each condition to take up a single line, there would have to be a drop-down list like with "Color label" that references SQL queries saved elsewhere in the UI, probably Settings.
This wouldn't be just for SQL knowledgeable users - it would allow users who know SQL to help those who don't by posting to the forums, telling the less technical users to just do [small set of easy steps] in the UI, and now you can easily do what you want in search from now on.
Or people could get the IT people to do it, their computer consultant, programmer friend, etc.