SQLite Forum

How to address a variable within a WITH statement
Login
I imagine something along the lines of

```
WITH
  pi (projid) AS (VALUES('PR0000019191')),
  LastEntries(projid,ml_insert)
  AS ( 
    SELECT projid max(insertdate)
    FROM pi
    JOIN Project_Keytask_and_Milestones
    USING(projid)
  )
SELECT ...;
```

might do the trick?