---
schema_version: "1"
id: cba033f489ef408b153de8a9d17e491b97bba2de833d921715eaecaf16259e1c
title: position({search_str} IN {source_str})
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/analytics/bi_dev_guide_sql/guides/bi-sql-string-position.md
canonical_url: https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-string-position.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: d21bb6ddca6426d9a7a229b3e587255657452004846614c8ea8890958eb09586
products:
  - SQL for Analytics Developer Guide
  - analytics
---

# position({search_str} IN {source_str})

Returns an integer that indicates the first occurrence of a substring in a given string. If the substring is not found, the function returns 0.

## Example

This example returns the position of the substring “der” in the City field.

```nolang
SELECT City, POSITION('der' IN City) as "Pos"
FROM "Superstore"
LIMIT 5;
```

| City            | Pos |
| --------------- | --- |
| Henderson       | 4   |
| Henderson       | 4   |
| Los Angeles     | 0   |
| Fort Lauderdale | 9   |
| Fort Lauderdale | 9   |
