Derived tables,CTE and Views produces the same result

vishalneeraj-24503
Posted by vishalneeraj-24503 under Sql Server category on | Points: 40 | Views : 779
--derived table produces the same results
select created_month
from (select month(created_date) as created_month
from employee_master) as o
group by created_month;

--cte produces the same results
with cte_e
as
(
select month(created_date) as created_month
from employee_master
)
select * from cte_e group by created_month

--view produces the same results
drop view vw_e
create view vw_e
as
(
select month(created_date) as created_month
from employee_master
)
select * from vw_e group by created_month;

Comments or Responses

Login to post response