Is there a way to define a named constant/parameter in a single-statement SQL query?
<p>Tried to do something like:</p>

<pre><code>WITH
dates as (SELECT '2015-01-01' as start, '2016-01-01' as end)
SELECT * FROM my_table WHERE start_date &gt;= dates.start AND end_date &lt;= dates.end
</code></pre>

<p>But got the error message "Relation 'dates' does not exist" (in Vertica). Is there any proper way to define a constant/parameter. In real example the query contains multiple selects over a defined time range, hence I'd like to maintain the values constants/parameters in a single place to allow them to be reused in the nested subqueries. </p>

<p>IF possible, I'd like to refrain from DECLARE/SET-like statements, where a separate line is required.</p>