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 / suraj kedia
Hi Sanjay,
the query u posted is a bit wrong,1st u have to do group by
n then having clause comes n not vise versa. so the final
query will be as below:
UPDATE emp
SET sal=sal+500
WHERE hiredate IN (SELECT hiredate
FROM employees
GROUP BY hiredate
HAVING COUNT(hiredate)>1
)
Hi Srinu,
It doesn't matter whether u write count(*) or
count(hiredate),the answer will always the same but its
better to give count(hiredate) only as it is easier to
understand.
| Is This Answer Correct ? | 6 Yes | 2 No |
Post New Answer View All Answers
What is deployment group?
Hi, There is a session in my workflow which is running for a long time, atlast we found the cause is the missing index. My session is running via a stored procedure. Can I create an Index on the table which the stored procedure is using while my session is running? Please suggest. My Informatica version is PC 8.0.6 My Oracle APPS is 11.5.3. Thanks,
Design a mapping to load the cumulative sum of salaries of employees into target table?
What is transformation?
hi,this is satheesh working as pl/sql resource in MNC.i just wanna switch to informatica.Could you please let me know what is the best way to learn informatica.what are the best coaching centres available in chennai?Is there any coaching centre will give me a real time experience? informatica
Define joiner transformation?
To import the flat file definition into the designer where should the flat file be placed?
How can we use mapping variables in informatica?
What you know about transaction control transformation?
What are the components of Informatica? And what is the purpose of each?
What is substr in informatica?
What is a stored procedure transformation?
Reusable transformation and shortcut differences
is there any way to read the ms excel datas directly into informatica?like is there any possibilities to take excel file as target?
How many types of sessions are there in informatica.please explain them?