YQL is not exactly SQL per say. It is a "SQL like" language. It does not query a database instead in the background makes REST calls to the backends.
Since I don't know what table you are querying, from what I understood from the question, what you are saying can be achieved. Read the yql doc here. Sample query select * from local.search where query="sushi" and location="san francisco, ca" and Rating.TotalRatings < "12"
I know its strange that we are comparing against a string value but it does work. You can test this on the YQL console here (just copy paste the query in the text box). Let me know if you have any questions/concerns. I will try to answer it to best of my knowledge.