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...

How can you find the 2nd Highest salary in a file department wise in abinitio?

Answer Posted / raje0303

Hi Murali,

This logic is correct only will fail when highest salary entries are more than one (e.g. two people has highest and equal salary )
we need to updated scan function as below -

type temporary_type=record
integer(4) temp1;
integer(4) last_sal;
end;

temp :: initialize(in) =
begin
temp.temp1::0;
temp.last_sal::0;
end;



out :: scan(temp, in) =
begin
if(last_sal != in.salary)
begin
out.temp1 :: temp.temp1 + 1;
end;
last_sal = in.salay;
end

out :: finalize(temp, in) =
begin
out.sal:: in.sal;
out.dno :: in.dno;
out.temp1 :: temp.temp1;
end;
out :: output_select(out) =
begin
out::out.temp1 == 2;
end;
###############################################
4.Output_file

Is This Answer Correct ?    6 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What do you mean by a transaction file and how it is different from that of a sort file?

1048


In abinitio, what types of parallelism are used?

1091


Explain about ab initio’s dependency analysis?

1168


Describe what the SQL Server tempdb and tlog files are used for?

2340


How to create a repository in abinitio for stand-alone system(local nt)?

1121


Mention what are the different types of parallelism used in abinitio?

1117


What are the reasons for which business can trust the approach of data processing?

1185


How do you add default rules in the transformer?

1179


When running a stored procedure definition script how would you guarantee the definition could be rolled back in the event of problems?

1140


What are the kinds of layouts does ab initio supports?

1000


What are differences between different gde versions(1.10,1.11,1.12,1.13and 1.15)?

1100


What is a partition and what are the different types of partition components in abinitio?

1273


what is the difference between i)public ii)private iii)common and client projects?

2230


What does it mean by the term 'sort component'?

1098


What is the function that transfers a string into a decimal?

1158