vendredi 16 octobre 2015

Result of a sql query to a new table

In the below sql query, the Subquery executes successfully,when trying to store the results of that subquery to a new table t_test.I am getting error as

Incorrect syntax near ')'

select * into t_test from
(select prm.RNumber,
case when pom.Category = 'Medicine'
    then pom.field
    end  as [Dept],
pop.branch
from tbl_pr_m prm join tbl_po_m pom on prm.rnumber = pom.rnumber
join tbl_po_p pop on prm.rnumber = prm.rnumber);

May i know, how to store the results to a new table t_test.

Aucun commentaire:

Enregistrer un commentaire