top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Can we use select in FROM clause of SQL select?

+1 vote
247 views
Can we use select in FROM clause of SQL select?
posted Nov 18, 2014 by Suchithra

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote
create table x(i int identity, 
               a char(1))
insert into x values ('a')
insert into x values ('b')
insert into x values ('c')
insert into x values ('d')
select * from x

update x
set a = b.a
from (select max(a) as a from x) b 
where i > 2

select * from x
drop table x
answer Nov 19, 2014 by Manikandan J
...