> ## 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.

<AgentInstructions>

## Submitting Feedback

If you encounter incorrect, outdated, or confusing documentation on this page, submit feedback:

POST https://docs.firebolt.io/feedback

```json
{
  "path": "/reference-sql/functions-reference/numeric/bit_shift_left",
  "feedback": "Description of the issue"
}
```

Only submit feedback when you have something specific and actionable to report.

</AgentInstructions>

> Reference material for BIT_SHIFT_LEFT

# BIT_SHIFT_LEFT

export const QueryWindow = ({content}) => {
  const {sql, result} = content;
  const [inited, setInited] = useState(false);
  const buttonRef = useRef(null);
  useEffect(() => {
    if (!inited && buttonRef.current) {
      runQuery(buttonRef.current, true);
      setInited(true);
    }
  }, []);
  return <div className="query-window">
      <div className="query-toolbar">
        <button className="run-button" onClick={ev => runQuery(ev.target)} ref={buttonRef}>Run Query</button>
        <span className="window-title">Interactive SQL Playground 🔥</span>
      </div>
      <div className="query-content">
        <pre><code className="firebolt-sql language-sql" contentEditable="true" spellCheck="false" data-original-query={sql}>{sql}</code></pre>
        <script type="application/json" className="fallback-result" style={{
    display: "none"
  }}>{JSON.stringify(result)}</script>
        <div className="server-unavailable-banner query-window-hidden">
          The Firebolt playground server is currently unavailable. Using precomputed query results.
        </div>
        <div className="query-results"></div>
      </div>
    </div>;
};

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":"github-light","dark":"github-dark"}}
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`:

<QueryWindow
  content={{
"sql": "SELECT bit_shift_left(1, 2) AS res;",
"result": {
"data": [
  [
    4
  ]
],
"meta": [
  {
    "name": "res",
    "type": "int"
  }
],
"query": {
  "query_id": "9f3fdcd0-6945-4bbf-8818-fdbbaf0c3561",
  "query_label": null,
  "request_id": "72d323c0-db9f-44d4-b7af-8c52f0aafdb3"
},
"rows": 1,
"statistics": {
  "bytes_read": 1,
  "elapsed": 0.006993,
  "rows_read": 1,
  "scanned_bytes_cache": 0,
  "scanned_bytes_storage": 0,
  "time_before_execution": 0.000246771,
  "time_to_execute": 8.6693e-05
}
}
}}
/>

**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`:

<QueryWindow
  content={{
"sql": "SELECT bit_shift_left(5, 2) AS res;",
"result": {
"data": [
  [
    20
  ]
],
"meta": [
  {
    "name": "res",
    "type": "int"
  }
],
"query": {
  "query_id": "423e0cd2-a115-4b28-bcfe-27ed139fd36d",
  "query_label": null,
  "request_id": "e6a02b0f-b207-4d64-b724-94721b209ca6"
},
"rows": 1,
"statistics": {
  "bytes_read": 1,
  "elapsed": 0.005985,
  "rows_read": 1,
  "scanned_bytes_cache": 0,
  "scanned_bytes_storage": 0,
  "time_before_execution": 0.00023814,
  "time_to_execute": 9.0034e-05
}
}
}}
/>

**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`:

<QueryWindow
  content={{
"sql": "SELECT bit_shift_left(-3, 1) AS res;",
"result": {
"data": [
  [
    -6
  ]
],
"meta": [
  {
    "name": "res",
    "type": "int"
  }
],
"query": {
  "query_id": "4445cde0-011a-4a96-836d-b37b65f7d367",
  "query_label": null,
  "request_id": "876e9e34-ab78-4793-a390-f7d0950c15a2"
},
"rows": 1,
"statistics": {
  "bytes_read": 1,
  "elapsed": 0.007015,
  "rows_read": 1,
  "scanned_bytes_cache": 0,
  "scanned_bytes_storage": 0,
  "time_before_execution": 0.000236362,
  "time_to_execute": 8.672e-05
}
}
}}
/>
