---
title: join.inner() function
description: join.inner() performs an inner join on two table streams.
url: https://docs.influxdata.com/flux/v0/stdlib/join/inner/
estimated_tokens: 1884
product: Flux
version: v0
---

# join.inner() function

-   Flux 0.172.0+
-   View InfluxDB support

`join.inner()` performs an inner join on two table streams.

The function calls `join.tables()` with the `method` parameter set to `"inner"`.

##### Function type signature

```js
(<-left: stream[A], as: (l: A, r: B) => C, on: (l: A, r: B) => bool, right: stream[B]) => stream[C] where A: Record, B: Record, C: Record
```

For more information, see [Function type signatures](/flux/v0/function-type-signatures/).

## Parameters

### left

Left input stream. Default is piped-forward data (<-).

### right

(Required) Right input stream.

### on

(Required) Function that takes a left and right record (`l`, and `r` respectively), and returns a boolean.

The body of the function must be a single boolean expression, consisting of one or more equality comparisons between a property of `l` and a property of `r`, each chained together by the `and` operator.

### as

(Required) Function that takes a left and a right record (`l` and `r` respectively), and returns a record. The returned record is included in the final output.

## Examples

### Perform an inner join

```js
import "sampledata"
import "join"

ints = sampledata.int()
strings = sampledata.string()

join.inner(
    left: ints,
    right: strings,
    on: (l, r) => l._time == r._time,
    as: (l, r) => ({l with label: r._value}),
)
```

[](#view-example-output)

View example output

#### Output data

| _time | _value | label | *tag |
| --- | --- | --- | --- |
| 2021-01-01T00:00:00Z | -2 | smpl_g9qczs | t1 |
| 2021-01-01T00:00:10Z | 10 | smpl_0mgv9n | t1 |
| 2021-01-01T00:00:20Z | 7 | smpl_phw664 | t1 |
| 2021-01-01T00:00:30Z | 17 | smpl_guvzy4 | t1 |
| 2021-01-01T00:00:40Z | 15 | smpl_5v3cce | t1 |
| 2021-01-01T00:00:50Z | 4 | smpl_s9fmgy | t1 |

| _time | _value | label | *tag |
| --- | --- | --- | --- |
| 2021-01-01T00:00:00Z | 19 | smpl_b5eida | t2 |
| 2021-01-01T00:00:10Z | 4 | smpl_eu4oxp | t2 |
| 2021-01-01T00:00:20Z | -3 | smpl_5g7tz4 | t2 |
| 2021-01-01T00:00:30Z | 19 | smpl_sox1ut | t2 |
| 2021-01-01T00:00:40Z | 13 | smpl_wfm757 | t2 |
| 2021-01-01T00:00:50Z | 1 | smpl_dtn2bv | t2 |

#### Related

-   [Perform an inner join](/flux/v0/join-data/inner/)
-   [Troubleshoot join operations](/flux/v0/join-data/troubleshoot-joins/)

[transformations](/flux/v0/tags/transformations/)
