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 / vicky

update emp2 e2 set e2.empname = (select e1.empname from
emp1 e1 where e2.empid=e1.empid)

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a mutating table error and how can you get around it?

532


You want to be sure that queries in a database always execute at the maximum possible speed. To achieve this goal you have created various indexes on tables which other statement will keep the database in good condition?

529


What are different types of raid configurations? : SQL Server Architecture

565


What are different backups available in sql server?

599


What do you understand by the denormalisation?

545






What does REVERT do in SQL Server 2005?

548


What is the rdl file?

88


Can we run Reporting Services with SQL Server express edition, which is a free version of SQL Server?

78


you have developed an application which uses many stored procedures and triggers to update various tables users ocassionally get locking problems which tool is best suited to help you diagnose the problem? : Sql server administration

527


Write an sql query for deleting duplicate rows?

546


If user is owning any SQL Objects, can we drop that user

1600


sql database suspect We have a sql database that is showing as suspect. How can we recover?

1395


How you can minimize the deadlock situation?

546


How do you create an execution plan?

487


What is similarity and difference between truncate and delete in sql?

580