# WITH Keyword

### Description

Introduces a Common Table Expression (CTE) for complex queries

### Syntax

```sql
WITH cte_name AS (
    SELECT ...
)
SELECT ...
FROM cte_name;
```

### Example

```sql
WITH
  employee_2025 as (
    SELECT
      id,
      start_date
    from
      rippling.employee.Employee
    where
      start_date > DATE(2025, 01, 01)
  )
SELECT
  e.id,
  e.full_name,
  employee_2025.start_date
FROM
  rippling.employee.Employee e
  JOIN employee_2025 USING (id);
```

Source: https://developer.rippling.com/documentation/rippling-platform/transformations/sql-reference/with

> For the complete documentation index, see [llms.txt](https://developer.rippling.com/llms.txt). Public pages have a Markdown version at the same URL with .md added.
