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
Advertisements

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s