On Tue, Apr 11, 2017 at 5:41 PM, Rob Sargent <robjsargent(at)gmail(dot)com> wrote:
> I have a lovely little CTE/select doing exactly what I need it to do.
> Unfortunately I need its results in the next query.
Can't you just chain the CTEs? E.g.,
with segset as (
--...
)
, optmarkers as (
select m.id as mkrid
--...
group by m.id
)
select s.id, o.optval, min(m.basepos) as firstbase
from optmarkers o
--...
order by firstbase;
No temp table to drop.
rls
--
:wq