--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;