473,756 Members | 2,652 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

PL/SQL theoretical questions

kiss07
99 New Member
Hi,

i want 2 and 3 rd max salary in a table .i want a single query.

please help..

Arun
Apr 23 '07 #1
70 6214
mailtothiyagarajan
1 New Member
Hi,

i want 2 and 3 rd max salary in a table .i want a single query.

please help..

Arun
I have used the inline view concept for this


Query for nth max salary :

select s.salary from
(
(
select dense_rank() over (order by max(salary) desc) n,salary
from
employee
) s
)
where s.n=&n;
Apr 24 '07 #2
bonzi1405
5 New Member
Below will return n,n+1 higest salary of a table.


select min(salary) sal
from
( select salary from employee order by salary desc)
where rownum<=&n
union
select min(salary) sal
from
( select salary from employee order by salary desc)
where rownum<=&n+1
May 3 '07 #3
debasisdas
8,127 Recognized Expert Expert
Dear
mailtothiyagara jan

have u tested the code before posting
May 3 '07 #4
Mani kansal
11 New Member
select sal from (select sal from emp order by sal desc) where rownum in(2,3)
May 3 '07 #5
kiss07
99 New Member
Dear friends,

I known about pre defined exception:
i want a sample programs in each of predefined exception.

example:

invalid cursor :

one sample program. when exception is raised in ivvalid cursor
same as others exceptions...


pls anybody help....

arun..
May 7 '07 #6
kiss07
99 New Member
Dear debas,

Can u explain about sql tuning:

what are the steps are doing sql tuning . I want to know about basic ideas

in sql tuning and performance tuning. what are the types?..

Pls...

Arunkumar...
May 7 '07 #7
debasisdas
8,127 Recognized Expert Expert
PLease follow this Link

Hope it might be useful for u.
May 7 '07 #8
debasisdas
8,127 Recognized Expert Expert
Invalid cursor exception is raised when u try to do somthing which is not allowed .
for ex

accesing the cursor variable after the cursor is closed.
May 7 '07 #9
debasisdas
8,127 Recognized Expert Expert
ZERO_DIVIDE exception
=============== ========
Expand|Select|Wrap|Line Numbers
  1. DECLARE
  2. I INT:=&I;
  3. J INT:=&J;
  4. K INT;
  5. BEGIN
  6. K:=I/J;
  7. DBMS_OUTPUT.PUT_LINE(K);
  8. EXCEPTION
  9. WHEN ZERO_DIVIDE THEN
  10. RAISE_APPLICATION_ERROR(-20002,'CANT DIVIDE BY ZERO.....!');
  11. WHEN OTHERS THEN
  12. RAISE_APPLICATION_ERROR(-20003,'SOME OTHER ERROR........!');
  13. END;
  14.  
  15.  
May 7 '07 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

16
1872
by: Materialised | last post by:
I have been given the task, of developing a program to sit next to a cgi based c program (I know this is offtopic but my question does only refer to the standard c part of the code). Basically what the program needs to do, is open a text file, containing hundreds maybe even thousands of items, and remove duplicate items. Also if the line length exceds a certian amount of characters, I wish to remove it. I was thinking of using malloc...
0
4101
by: softwareengineer2006 | last post by:
All Interview Questions And Answers 10000 Interview Questions And Answers(C,C++,JAVA,DOTNET,Oracle,SAP) I have listed over 10000 interview questions asked in interview/placement test papers for all companies between year 2000-2005 in my website http://www.geocities.com/allinterviewquestion/ So please have a look and make use of it.
0
4596
by: connectrajesh | last post by:
INTERVIEWINFO.NET http://www.interviewinfo.net FREE WEB SITE AND SERVICE FOR JOB SEEKERS /FRESH GRADUATES NO ADVERTISEMENT
2
7225
by: freepdfforjobs | last post by:
Full eBook with 4000 C#, JAVA,.NET and SQL Server Interview questions http://www.questpond.com/SampleInterviewQuestionBook.zip Download the JAVA , .NET and SQL Server interview sheet and rate yourself. This will help you judge yourself are you really worth of attending interviews. If you own a company best way to judge if the candidate is worth of it. http://www.questpond.com/InterviewRatingSheet.zip
4
2512
by: Drew | last post by:
I posted this to the asp.db group, but it doesn't look like there is much activity on there, also I noticed that there are a bunch of posts on here pertaining to database and asp. Sorry for cross-posting. I am trying to build a "checklist", where a user can navigate to an ASP page on the intranet which shows a list of "questions" that the user can check off. I am trying to figure out how to do this so that it is scalable, but I am...
8
783
by: sqlservernewbie | last post by:
Hi Everyone, Here is a theoretical, and definition question for you. In databases, we have: Relation
8
7984
by: Krypto | last post by:
Hi, I have used Python for a couple of projects last year and I found it extremely useful. I could write two middle size projects in 2-3 months (part time). Right now I am a bit rusty and trying to catch up again with Python. I am now appearing for Job Interviews these days and I am wondering if anybody of you appeared for a Python Interview. Can you please share the questions you were asked. That will be great help to me.
0
1469
by: Joseph Ferris | last post by:
Good afternoon, I understand the basic theories of capacity planning as it relates to profiling an existing web site, such as in the examples given in the MSDN Article, "How To: Perform Capacity Planning for .NET Applications" http://msdn2.microsoft.com/en-us/library/ ms979198.aspx]. This assumes the existence of an application to profile, though. What is a good way to perform a more abstract, theoretical assessment
0
1500
by: ramu | last post by:
C# Interview Questions and Answers8 http://allinterviewsbooks.blogspot.com/2008/07/c-interview-questions-and-answers8.html C# Interview Questions and Answers7 http://allinterviewsbooks.blogspot.com/2008/07/c-interview-questions-and-answers7.html C# Interview Questions and Answers 6 http://allinterviewsbooks.blogspot.com/2008/07/c-interview-questions-and-answers-6.html C# Interview Questions and Answers 5...
0
9455
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9271
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9869
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9708
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7242
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6534
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5302
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3805
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3354
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.