yagneswara babu


{ City } anantapur
< Country > india
* Profession * se
User No # 13392
Total Questions Posted # 3
Total Answers Posted # 2

Total Answers Posted for My Questions # 15
Total Views for My Questions # 34283

Users Marked my Answers as Correct # 74
Users Marked my Answers as Wrong # 46
Questions / { yagneswara babu }
Questions Answers Category Views Company eMail

select top 5 * from emp order by newid() my question is , how this query get executed?

5 SQL Server 9768

how to get the rowid/rownumbes of a table in sqlserver

IBM,

7 SQL Server 17265

how to give input dynamically to a insert statement in sqlserver

HCL,

3 SQL Server 7250




Answers / { yagneswara babu }

Question { Oracle, 51082 }

How to find the second largest salary in the emp database and
also How to find 3rd,4th and so on ........ in the emp database

plz mail the answer @ mak2786@gmail.com


Answer

TO FIND THE SECOND HIGHEST SAL IN EMP TABLE

select max(sal) from emp where sal not in(select max(sal)
from emp)

TO FIND THE 3RD HIGHEST SAL IN EMP TABLE

select max(sal) from emp where sal not in(select distinct
top 2 sal from emp order by sal desc)

TO FIND THE Nth HIGHEST SAL IN EMP TABLE

select max(sal) from emp where sal not in(select distinct
top N-1 sal from emp order by sal desc)

yagneswara babu
yagnesh_sn@yahoo.co.in

Is This Answer Correct ?    39 Yes 6 No

Question { 46857 }

write a program to generate 1st n fibonacci prime number


Answer

void main()
{
int x1,x2,x3,n,i;
x1=0;
x2=1;
printf("enter a value for n : ");
scanf("%d",&n);
printf("%d %d ",x1,x2);
for(i=3;i<=n;i++)
{
x3=x1+x2;
printf("%d ",x3);
x1=x2;
x2=x3;
}
}

Is This Answer Correct ?    35 Yes 40 No