> ## 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/string/position",
  "feedback": "Description of the issue"
}
```

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

</AgentInstructions>

> Reference material for POSITION function

# POSITION

Returns the position of the substring found in the string, starting from 1. The returned value is for the first matching value, and not for any subsequent valid matches.
In case the substring does not exist, functions will return 0.

## Syntax

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
POSITION(<substring> IN <string>)
```

## Parameters

| Parameter     | Description                       | Supported input types |
| :------------ | :-------------------------------- | :-------------------- |
| `<substring>` | The substring to search for.      | `TEXT`                |
| `<string>`    | The string that will be searched. | `TEXT`                |

## Return Type

`INTEGER`

## Example

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
SELECT
	POSITION('hello' IN 'hello world') AS res;
```

**Returns**: `1`

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
SELECT
	POSITION('world' IN 'hello world') AS res;
```

**Returns**: `7`

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
SELECT
	POSITION('work' IN 'hello world') AS res;
```

**Returns**: `0`
