Implement nested clauses, still need to support it in SQLite backend.