# SemiJoinSubqueryBuilder (/docs/core/reference/api/interfaces/SemiJoinSubqueryBuilder)



[@kysoql/core](/docs/core/reference/api) / SemiJoinSubqueryBuilder

Builder for the filtering portion of a semi-join subquery.

## Extends [#extends]

* `SemiJoinWhereBuilder`\<`DB`, `TB`, `SemiJoinSubqueryBuilder`\<`DB`, `OuterTB`, `OuterReference`, `TB`>>

## Type Parameters [#type-parameters]

| Type Parameter                      |
| ----------------------------------- |
| `DB`                                |
| `OuterTB` *extends* keyof `DB`      |
| `OuterReference` *extends* `string` |
| `TB` *extends* keyof `DB`           |

## Methods [#methods]

<a id="api-call" />

### $call() [#call]

```ts
$call<T>(func): T;
```

Passes this builder to `func` and returns the callback result.

#### Type Parameters [#type-parameters-1]

| Type Parameter |
| -------------- |
| `T`            |

#### Parameters [#parameters]

| Parameter | Type          |
| --------- | ------------- |
| `func`    | (`qb`) => `T` |

#### Returns [#returns]

`T`

***

<a id="api-if" />

### $if() [#if]

```ts
$if(condition, func): this;
```

Conditionally applies a builder callback; when false, the runtime query is unchanged.

#### Parameters [#parameters-1]

| Parameter   | Type             |
| ----------- | ---------------- |
| `condition` | `boolean`        |
| `func`      | (`qb`) => `this` |

#### Returns [#returns-1]

`this`

***

<a id="api-clearwhere" />

### clearWhere() [#clearwhere]

```ts
clearWhere(): this;
```

Returns a builder with the `WHERE` predicate removed.

#### Returns [#returns-2]

`this`

***

<a id="api-select" />

### select() [#select]

```ts
select<SE>(selection): SelectedSemiJoinSubqueryBuilder<DB, OuterTB, OuterReference, TB>;
```

Adds one or more typed selections to the query output.

#### Type Parameters [#type-parameters-2]

| Type Parameter          |
| ----------------------- |
| `SE` *extends* `string` |

#### Parameters [#parameters-2]

| Parameter   | Type                                                                                |
| ----------- | ----------------------------------------------------------------------------------- |
| `selection` | `SE` & `SemiJoinSelectionFieldName`\<`DB`, `OuterTB`, `OuterReference`, `TB`, `SE`> |

#### Returns [#returns-3]

[`SelectedSemiJoinSubqueryBuilder`](/docs/core/reference/api/interfaces/SelectedSemiJoinSubqueryBuilder)\<`DB`, `OuterTB`, `OuterReference`, `TB`>

***

<a id="api-where" />

### where() [#where]

#### Call Signature [#call-signature]

```ts
where(expression): SemiJoinSubqueryBuilder;
```

##### Parameters [#parameters-3]

| Parameter    | Type                                                                                                           |
| ------------ | -------------------------------------------------------------------------------------------------------------- |
| `expression` | [`WhereExpressionFactory`](/docs/core/reference/api/type-aliases/WhereExpressionFactory)\<`DB`, `TB`, `false`> |

##### Returns [#returns-4]

`SemiJoinSubqueryBuilder`

##### Inherited from [#inherited-from]

```ts
SemiJoinWhereBuilder.where
```

#### Call Signature [#call-signature-1]

```ts
where<RE, OP, RHS>(
   lhs,
   op,
   rhs
): SemiJoinSubqueryBuilder;
```

##### Type Parameters [#type-parameters-3]

| Type Parameter                                                                                                                                                                                                                                                                    |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `RE` *extends* `string`                                                                                                                                                                                                                                                           |
| `OP` *extends* \| `"="` \| `"!="` \| [`OrderedComparisonOperator`](/docs/core/reference/api/type-aliases/OrderedComparisonOperator) \| `"in"` \| `"not in"` \| [`MultiSelectComparisonOperator`](/docs/core/reference/api/type-aliases/MultiSelectComparisonOperator) \| `"like"` |
| `RHS`                                                                                                                                                                                                                                                                             |

##### Parameters [#parameters-4]

| Parameter | Type                                            |
| --------- | ----------------------------------------------- |
| `lhs`     | `RE` & `FilterableFieldName`\<`DB`, `TB`, `RE`> |
| `op`      | `OP`                                            |
| `rhs`     | `RHS`                                           |

##### Returns [#returns-5]

`SemiJoinSubqueryBuilder`

##### Inherited from [#inherited-from-1]

```ts
SemiJoinWhereBuilder.where
```
