# points_string

String time series: enum labels, state names, identifiers, and other text-valued channels.

Telemetry table, so every query must filter by `dataset_rid`.

For what a channel is, see [Channels](https://dev.nominal.io/platform/data-model.md#channels) in the data model.

## Columns

| Column | Type | Nullable | Notes |
| --- | --- | --- | --- |
| `ts` | `TIMESTAMP` | No | Sample time, nanosecond precision. |
| `value` | `VARCHAR` | Yes | The sample. Null where a sample exists but carries no value. |
| `channel` | `VARCHAR` | No | Channel name. |
| `dataset_rid` | `VARCHAR` | No | Dataset the sample belongs to. Required in the `WHERE` clause. |
| `tags` | `MAP` | No | Key-value pairs recorded with the series. See [Filtering by tag](https://dev.nominal.io/sql-guides/writing-queries.md#filtering-by-tag). |

## Examples

Read a state channel in time order:

```sql
SELECT ts, value
FROM points_string
WHERE dataset_rid = '<dataset-rid>'
  AND channel = 'flight_mode'
ORDER BY ts
LIMIT 1000
```

Count how often each distinct value appeared:

```sql
SELECT value AS mode, COUNT(*) AS samples
FROM points_string
WHERE dataset_rid = '<dataset-rid>'
  AND channel = 'flight_mode'
GROUP BY value
ORDER BY samples DESC
```

String comparison is case-sensitive, so match the value exactly as recorded. `UPPER` and `LOWER` are available if you need to normalize:

```sql
SELECT ts, value
FROM points_string
WHERE dataset_rid = '<dataset-rid>'
  AND UPPER(value) = 'ARMED'
ORDER BY ts
```

## Next steps

- [Function reference](https://dev.nominal.io/sql-reference/schema/function-reference.md): the available string functions.
- [points_struct](https://dev.nominal.io/sql-reference/schema/points_struct.md): structured values rather than plain text.
