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


Please Help Members By Posting Answers For Below Questions

update strategy transformation in informatica

628


whats the logic to load the lower level of granularity of data to fact table.

1785


What do you mean by blocking transformation?

567


Dimension Object created in Oracle can be imported in Designer Cubes contain measures

1921


What are connected or unconnected transformations?

616






Explain how many types of dimensions are available in informatica?

577


What is mapping debugger?

557


What does role playing dimension mean?

609


difference between informatica 8.1.1 and 8.6

3229


if i hv 6 table as source table but can i make 12 as a dim table and 6 as fact table belongs to that src table.

1744


In informatics server which files are created during the session rums?

618


How many ways are there to create ports?

703


Explain lookup transformation in informatica

634


how to construct simple biogas digerter? please show me detail drawing and specification of simple biogas construction?

1957


What is meant by active and passive transformation?

572