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

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);

above is Posted By

Sukanta

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

I have 10 columns in a flat file and 10 rows corresponding to that columns. I want column number 5 and 6 for last five records. In unix as well as informtica.

1178


lookup transformation with screenshots

3535


Partition, what happens if the specified key range is shorter and longer

2004


if we have a delimiters at unwanted places in a flat file how can we over come those.

1536


how many types of dimensions are available in informatica?

535






what is degenerated dimension?

3124


What is a standalone command task?

627


How can we store previous session logs?

544


What is the benefit of partitioning a session?

600


What are batches?

591


Explain the use of aggregator cache file?

642


How many ways are there to create ports?

684


How to join three sources using joiner? Explain though mapping flow.

662


Global and Local shortcuts. Advantages.

1436


How to go to the older version for a mapping?

570