Just naturally paste your first query inside the parenthesis, as in:
with v as (select * from (values ('a','b'),('c','d')) v (e,f)) select e from v where f='d';