MUTANT TABLE DOES NOT EXIST.MY QUERY IS WORKING FINE BUT WHEN I AM TRYING TO PUT THE RESULT IN A NEW TABLE WHICH DOESN’T EXIST,IT IS SHOWING SOME ERROR.
select
'Ordinary' ,
pincode ,
year ( Date_val ),
MONTH ( Date_val ),
(100 - cast ( Arr_8 as int )/ cast ( Arr_5 as int )* 100 )
into mutant
from
(
select * from arrow_29june_2010 union all
select * from arrow_dtp_upg_2009
) A
where
cast ( arr_5 as int )<> 0
You need to name columns in select in order to insert them into new table:
EDIT: forgot to alias ‘Ordinary’