Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is the meaning of up gradation of repository?

1961


How to load a Dimension ? and how to load a fact table?

1406


What are the differences between oltp and olap?

963


Suppose we do not group by on any ports of the aggregator what will be the output?

1033


what is the size of u r source(like file or table)?

2254


Which transformation should we use to normalise the COBOL and relational sources?

1185


How many numbers of sessions can one group in batches?

1054


How do you load only null records into target?

1199


What is the use of source qualifier?

1118


how to load dimension table and fact table. plz tell me the steps.

2085


Where are the source flat files kept before running the session?

1061


What are the different types of olap? Give an example?

1036


explain one complex mapping with logic? sales project?

6656


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?

2168


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?

1658