# Variable intersect`Const`

intersect: SQLiteCreateSetOperatorFn

Adds `intersect` set operator to the query.

Calling this method will retain only the rows that are present in both result sets and eliminate duplicates.

See docs: https://orm.drizzle.team/docs/set-operations#intersect

#### Example

    // Select course names that are offered in both departments A and B
    import { intersect } from 'drizzle-orm/sqlite-core'

    await intersect(
      db.select({ courseName: depA.courseName }).from(depA),
      db.select({ courseName: depB.courseName }).from(depB)
    );
    // or
    await db.select({ courseName: depA.courseName })
      .from(depA)
      .intersect(
        db.select({ courseName: depB.courseName }).from(depB)
      );

- Defined in node_modules/.pnpm/drizzle-orm@0.44.6_@cloudflare+workers-types@4.20251014.0_@opentelemetry+api@1.9.0_@typ_31a6f5ca8f102af87864dd251ed08d88/node_modules/drizzle-orm/sqlite-core/query-builders/select.d.ts:543