MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / intersect

Method intersect

lib/sqlalchemy/orm/query.py:2188–2199  ·  view source on GitHub ↗

Produce an INTERSECT of this Query against one or more queries. Works the same way as :meth:`~sqlalchemy.orm.query.Query.union`. See that method for usage examples. .. seealso:: :meth:`_sql.Select.intersect` - v2 equivalent method.

(self, *q: Query[Any])

Source from the content-addressed store, hash-verified

2186 return self._set_op(expression.union_all, *q)
2187
2188 def intersect(self, *q: Query[Any]) -> Self:
2189 """Produce an INTERSECT of this Query against one or more queries.
2190
2191 Works the same way as :meth:`~sqlalchemy.orm.query.Query.union`. See
2192 that method for usage examples.
2193
2194 .. seealso::
2195
2196 :meth:`_sql.Select.intersect` - v2 equivalent method.
2197
2198 """
2199 return self._set_op(expression.intersect, *q)
2200
2201 def intersect_all(self, *q: Query[Any]) -> Self:
2202 """Produce an INTERSECT ALL of this Query against one or more queries.

Callers

nothing calls this directly

Calls 1

_set_opMethod · 0.95

Tested by

no test coverage detected