In EMP table, for those emp whose Hiredate is same, update
their sal by "sal+500" or else for others keep the sal as it
is, how to do it by SQL query
Answer Posted / guest
update emp a set a.sal=a.sal+500 where a.hiredate in(select
max(b.hiredate) from emp b group by b.hiredate having
count(b.hiredate)>1);
or
update emp a set a.sal=a.sal+500 where a.hiredate=(select
max(b.hiredate) from emp b where a.hiredate=b.hiredate group
by b.hiredate having count(b.hiredate)>1);
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What is the meaning of up gradation of repository?
How to load a Dimension ? and how to load a fact table?
What are the differences between oltp and olap?
Suppose we do not group by on any ports of the aggregator what will be the output?
what is the size of u r source(like file or table)?
Which transformation should we use to normalise the COBOL and relational sources?
How many numbers of sessions can one group in batches?
How do you load only null records into target?
What is the use of source qualifier?
how to load dimension table and fact table. plz tell me the steps.
Where are the source flat files kept before running the session?
What are the different types of olap? Give an example?
explain one complex mapping with logic? sales project?
How can we send the flat file data to different targets(which are also flat files) based on the name of flat file with out adding extra columns?
Workflow is long running due to long running sql query so when we refer the query plan it tells the issue is due to partition of the db table. How to handle this?