Simplest CTE

Here’s my simplest working CTE, to play with …

drop table t1
create table t1 (c1 int)
insert into t1 values(10), (11), (12)

;with cte(x)
as
(select 11)

delete from t1 where c1 in (select x from cte)
select * from t1

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s