Click here to Skip to main content
15,913,610 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hai all,

I need to write a query i tried but i am getting errors

SQL
insert into ins_companyservicerates(CompanyId,BilltypeID,ServiceId,TestID,Rate,Code,Aliasname)
values(39,select billtypeid,serviceid,Testid,Rate,Code,Aliasname
from ins_companyservicerates where companyid = 31)

( I have a table ins_companyservicerates and companyid = 31 has more than 500 rows. So i need to copy this details with companyid = 39)

How can i do that?


Thanks

Afsal
Posted
Updated 21-May-14 3:00am
v2

1 solution

Try this:
SQL
insert into ins_companyservicerates(CompanyId,BilltypeID,ServiceId,TestID,Rate,Code,Aliasname)
select 39, billtypeid,serviceid,Testid,Rate,Code,Aliasname
 from ins_companyservicerates where companyid = 31
 
Share this answer
 
Comments
afsal.mp 21-May-14 9:28am    
Thank you very much... This is i was looking .. Thank you thank you.........

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900