473,386 Members | 1,694 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

writing a query to get the second highest value in atable by using select statement

writing a query to get the second highest value in atable by using select statement
Sep 12 '07 #1
5 4347
debasisdas
8,127 Expert 4TB
As you have posted a question in the articles section it is being moved to Oracle Forum.

MODERATOR.
Sep 12 '07 #2
debasisdas
8,127 Expert 4TB
writing a query to get the second highest value in atable by using select statement
Kindly post the query that you have tried to solve this.
Sep 13 '07 #3
writing a query to get the second highest value in atable by using select statement
Hi
try this

select level,max(salary) from emp1
where level=2
connect by prior salary>salary
group by level;

here salary->column
Sep 19 '07 #4
writing a query to get the second highest value in atable by using select statement
Hi
try this

select level,max(salary) from emp1
where level=2
connect by prior salary>salary
group by level;

here salary->column name
Sep 19 '07 #5
amitpatel66
2,367 Expert 2GB
Hi
try this

select level,max(salary) from emp1
where level=2
connect by prior salary>salary
group by level;

here salary->column name
Try below Query:

Expand|Select|Wrap|Line Numbers
  1. SELECT min(e.salary) FROM emp e WHERE 2 > (SELECT COUNT(*) FROM emp WHERE salary > e.salary)
  2.  
Sep 19 '07 #6

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

Similar topics

4
by: YoBro | last post by:
Hi, I have a database that stores in a field the number of views for a product. I want to write a query that gets the two highest views, so I can then output the result. I have this so far,...
13
by: dogu | last post by:
Noob alert. Code is below. File is saved as a .php. What I'm trying to do: User uses 'select' box drop down list to pick a value. Value ($site) is derived from a db query. This works fine....
8
by: Lauren Quantrell | last post by:
In VBA, I constructed the following to update all records in tblmyTable with each records in tblmyTableTEMP having the same UniqueID: UPDATE tblMyTable RIGHT JOIN tblMyTableTEMP ON...
1
by: Martin | last post by:
I have a table in which the records a bunch of fields; for this query, I'm interested in three of them - let's call them Fld1, Fld2 and Fld3. For each record in the table, these fields may or may...
3
by: Adam | last post by:
Hello, I have a 2 column file that looks like this: VALUE1 | VALUE2 12 | 7 10 | 7 9 | 8 10 | 8 11 | 8 6 | 9 8 | 9
6
by: Liz Malcolm | last post by:
Hello and Thanks in advance for any help. I am using Access 2000. I have a data entry form that opens a main form (using the On Click event of the combo box ) with tab controls and 1 subform on...
5
by: valglad | last post by:
Hi, The question below was posted about 4 years ago and noone was able to answer it back then. I have virtually the same type of problem so would appreciate if anyone can help. Thanks ...
9
by: Greg Strong | last post by:
Hello All, What is the maximum length of an ODBC pass through query? Things work fine with the code except when I try to create a view which is pretty complex in Oracle. I'm using a DSN...
0
by: georges the man | last post by:
The purpose: • Sorting and Searching • Numerical Analysis Design Specification You are to write a program called “StockAnalyser”. Your program will read a text file that contains historical...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.