write down the sql query?

Table Name : emp1
empid empname
1 bala
2 guna

Table Name : emp2
empid empname
1 <Null>
2 <Null>

Solution : emp1 names are updated in emp2, write a query?

Answer Posted / saravanan

update w set w.ename=q.ename from empn1 w,
(select e.ename,e.empid from empn e,empn1 a where
a.empid=e.empid) q where w.empid=q.empid

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are transactions in sql?

543


Which tcl commands are available on the sql server?

601


List out the difference between union and union all in sql server?

514


What types of replication are supported in sql server?

556


How to loop through result set objects using odbc_fetch_row()?

461






Explain insert into select statement?

516


What is temporal table?

472


Define Business Edition in SQL Azure?

88


How can delete duplicate records in cte in sql server?

511


What functions can a view be used to performed?

611


What is the downside of using udf?

556


What is autocommit mode in sql server?

539


How to create new table with "create table" statements?

550


What is stored procedures?

537


How can you insert values in multiple rows using one Insert statement?

609