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

> Reference material for BIT_SHIFT_LEFT

# BIT_SHIFT_LEFT

Shifts the bits in the first argument to the left by `n` bits, where `n` is the second argument. Shifting left by `n` positions is equivalent to multiplying the number by `2^n`.

## Syntax

```sql theme={"theme":{"light":"css-variables","dark":"css-variables"}}
BIT_SHIFT_LEFT(<value>, <bits>)
```

## Parameters

| Parameter | Description                   | Supported input types |
| :-------- | :---------------------------- | :-------------------- |
| `<value>` | Specifies the value to shift. | `INT`, `BIGINT`       |
| `<bits>`  | The number of bits to shift.  | `INT`                 |

## Return Types

The `BIT_SHIFT_LEFT` function returns a result of either type `INT` or `BIGINT`, depending on the type of the input `<expression>`.

## Examples

**Example**

The following code example shifts `0001`, the binary representation of `1`, to the left by two bits, which yields `0100`, the binary representation for `4`:

<div className="query-window">
  ```
  SELECT bit_shift_left(1, 2) AS res;
  ```

  | res <span>int</span> |
  | :------------------- |
  | 4                    |

  <p><span>Rows: 1</span><span>Execution time: 6.13ms</span></p>
</div>

**Example**

The following code example shifts `00101`, the binary representation of `5`, to the left by two bits, which yields `10100`, the binary representation of `20`:

<div className="query-window">
  ```
  SELECT bit_shift_left(5, 2) AS res;
  ```

  | res <span>int</span> |
  | :------------------- |
  | 20                   |

  <p><span>Rows: 1</span><span>Execution time: 6.22ms</span></p>
</div>

**Example**

The following code example shifts the binary representation of `-3`, which is `1111111111111101` in signed two's complement, one bit to the left, resulting in `1111111111111010`, the binary signed two's complement of `-6`:

<div className="query-window">
  ```
  SELECT bit_shift_left(-3, 1) AS res;
  ```

  | res <span>int</span> |
  | :------------------- |
  | -6                   |

  <p><span>Rows: 1</span><span>Execution time: 5.09ms</span></p>
</div>
