> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kinetica.com/llms.txt
> Use this file to discover all available pages before exploring further.

# filter_by_table

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generated/filter_by_table.rs#L44-L61)
pub async fn [filter\_by\_table](https://docs.kinetica.com/content/api/rust/gpudb/struct.Kinetica/filter-by-table.md#method.filter_by_table)( \&self, table\_name: [String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html), view\_name: [String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html), column\_name: [String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html), source\_table\_name: [String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html), source\_table\_column\_name: [String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html), ) -> [Result](https://doc.rust-lang.org/1.98.1/core/result/enum.Result.html)\<[FilterByTableResponse](https://docs.kinetica.com/content/api/rust/generated/api/struct.FilterByTableResponse.md), [KineticaError](https://docs.kinetica.com/content/api/rust/errors/enum.KineticaError.md)>

Filter a dataset for records with column values matching another table’s column valuesFilters objects in one table based on objects in another table. The user must specify matching column types from the two tables (i.e. the target table from which objects will be filtered and the source table based on which the filter will be created); the column names need not be the same. If a `view_name` is specified, then the filtered objects will then be put in a newly created view. The operation is synchronous, meaning that a response will not be returned until all objects are fully available in the result view. The return value contains the count (i.e. the size) of the resulting view.

##### Arguments

<ul>
  <li>`table_name` - Name of the table whose data will be filtered, in \[schema\_name.]table\_name format, using standard name resolution rules. Must be an existing table.</li>
  <li>`view_name` - If provided, then this will be the name of the view containing the results, in \[schema\_name.]view\_name format, using standard name resolution rules and meeting table naming criteria. Must not be an already existing table or view.</li>
  <li>`column_name` - Name of the column by whose value the data will be filtered from the table designated by `table_name`.</li>
  <li>`source_table_name` - Name of the table whose data will be compared against in the table called `table_name`, in \[schema\_name.]table\_name format, using standard name resolution rules. Must be an existing table.</li>
  <li>`source_table_column_name` - Name of the column in the `source_table_name` whose values will be used as the filter for table `table_name`. Must be a geospatial geometry column if in ‘spatial’ mode; otherwise, Must match the type of the `column_name`.</li>
</ul>

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generated/filter_by_table.rs#L97-L121)
pub async fn [filter\_by\_table\_with\_opts](https://docs.kinetica.com/content/api/rust/gpudb/struct.Kinetica/filter-by-table.md#method.filter_by_table_with_opts)( \&self, table\_name: [String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html), view\_name: [String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html), column\_name: [String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html), source\_table\_name: [String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html), source\_table\_column\_name: [String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html), options: [FilterByTableRequestOptions](https://docs.kinetica.com/content/api/rust/generated/api/struct.FilterByTableRequestOptions.md), ) -> [Result](https://doc.rust-lang.org/1.98.1/core/result/enum.Result.html)\<[FilterByTableResponse](https://docs.kinetica.com/content/api/rust/generated/api/struct.FilterByTableResponse.md), [KineticaError](https://docs.kinetica.com/content/api/rust/errors/enum.KineticaError.md)>

Filter a dataset for records with column values matching another table’s column valuesFilters objects in one table based on objects in another table. The user must specify matching column types from the two tables (i.e. the target table from which objects will be filtered and the source table based on which the filter will be created); the column names need not be the same. If a `view_name` is specified, then the filtered objects will then be put in a newly created view. The operation is synchronous, meaning that a response will not be returned until all objects are fully available in the result view. The return value contains the count (i.e. the size) of the resulting view.

##### Arguments

<ul>
  <li>`table_name` - Name of the table whose data will be filtered, in \[schema\_name.]table\_name format, using standard name resolution rules. Must be an existing table.</li>
  <li>`view_name` - If provided, then this will be the name of the view containing the results, in \[schema\_name.]view\_name format, using standard name resolution rules and meeting table naming criteria. Must not be an already existing table or view.</li>
  <li>`column_name` - Name of the column by whose value the data will be filtered from the table designated by `table_name`.</li>
  <li>`source_table_name` - Name of the table whose data will be compared against in the table called `table_name`, in \[schema\_name.]table\_name format, using standard name resolution rules. Must be an existing table.</li>
  <li>`source_table_column_name` - Name of the column in the `source_table_name` whose values will be used as the filter for table `table_name`. Must be a geospatial geometry column if in ‘spatial’ mode; otherwise, Must match the type of the `column_name`.</li>
  <li>`options` - The optional parameters; any left unset take the server’s defaults.</li>
</ul>

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generated/filter_by_table.rs#L124-L135)
pub async fn [filter\_by\_table\_raw](https://docs.kinetica.com/content/api/rust/gpudb/struct.Kinetica/filter-by-table.md#method.filter_by_table_raw)( \&self, request: &[FilterByTableRequest](https://docs.kinetica.com/content/api/rust/generated/api/struct.FilterByTableRequest.md), ) -> [Result](https://doc.rust-lang.org/1.98.1/core/result/enum.Result.html)\<[FilterByTableResponse](https://docs.kinetica.com/content/api/rust/generated/api/struct.FilterByTableResponse.md), [KineticaError](https://docs.kinetica.com/content/api/rust/errors/enum.KineticaError.md)>

Sends a pre-built [`FilterByTableRequest`](https://docs.kinetica.com/content/api/rust/generated/api/struct.FilterByTableRequest) to the `/filter/bytable` endpoint.

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generated/filter_by_table.rs#L139-L151)
pub async fn [filter\_by\_table\_from\_url](https://docs.kinetica.com/content/api/rust/gpudb/struct.Kinetica/filter-by-table.md#method.filter_by_table_from_url)( \&self, url: &[str](https://doc.rust-lang.org/1.98.1/std/primitive.str.html), request: &[FilterByTableRequest](https://docs.kinetica.com/content/api/rust/generated/api/struct.FilterByTableRequest.md), ) -> [Result](https://doc.rust-lang.org/1.98.1/core/result/enum.Result.html)\<[FilterByTableResponse](https://docs.kinetica.com/content/api/rust/generated/api/struct.FilterByTableResponse.md), [KineticaError](https://docs.kinetica.com/content/api/rust/errors/enum.KineticaError.md)>

Sends a pre-built [`FilterByTableRequest`](https://docs.kinetica.com/content/api/rust/generated/api/struct.FilterByTableRequest) to a specific worker URL, bypassing HA head-node selection. Used for multi-head access.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.