Output is here
SELECT * FROM `student` WHERE class='Six' ORDER BY mark DESC LIMIT 1,1
SELECT * FROM `student` where class='Six' ORDER BY mark desc LIMIT 0,1
Output of this query is here.
SELECT * FROM `student` WHERE class='Six' ORDER BY mark DESC LIMIT 0,3
Try to find out the second lowest mark of class six now
SELECT * FROM `student` where class = 'Six' ORDER BY mark ASC LIMIT 0,1
|gaurav singh kushwaha|
|select sal, count, rownum from (select sal , count(sal) count from salary group by sal order by sal desc) where rownum in (1,2,3)|
|Thank you for this post. Really helpful and easy to understand.|
|i count each product sold by using group by and count and i have to find maximum among them.i have tried with group by clause.but i can't|
|Mayank Singh Parmar|
|Very well written. Thanks for providing the student table.|
|the table data is id name price date 1 acc 10.10 24-SEP-2010 2 acc 15.10 26-SEP-2010 3 acc 13.10 27-SEP-2010 i want result as follows display id, max(price),date format in dd/mm/yyyy my price field is varchar|
|how to convert varchar values to int values|
|i m stuck in this situation. kindly some one help me. if the person have 16000 thousand amount in his account. and that person have to pay 14000 thousand to someone. and the result will be 2000 and next time when he will deposit his 4000 thousand then result will 4000 + 2000. how can i do this? thanx in advance|
|if I have a colum as sales_date,which has data type as date & default value as 2010-01-01(i.e 1st jan 2010).When I update rest of the data in next record, I want the date should be increamented in that record. Ex- 2nd record should have date as 2010-01-02 i.e 2 jan 2010. What could be the function to increament the date in next row?|
|jeet singh parmar|
|select * from tab_name where col1 = (select MAX(col1) from tab_name where col2 = value|
|how to add column values of a single record. ID s1 s2 s3 1 20 29 28 2 78 98 09 . I wanna add two highest col values of a single record|
|hey, i have a list of employees with various information in each recording including birthdate. can someone tell me how to write a single query that will return the oldest and youngest employee?|
|select max(sal) from emp where sal <(select max(sal) from emp); whether is this right or wrong for find second maximum salary in a table of content?|
|Hi, I need a sql query:- My Requirement is as follows:-|
I am working on a project which will take input from the user, & based on the inputs it will give the records.
For Eg:- I need to generate 5 sets of 20 questions . Each set of questions will contain 5 Java Ques, 8 DataBase, 5 .Net, 2 Subjective Questions. So, i am able to get the data from table all the 100 ques(5 X 20). Now before sending it to the user , i need to order the data .
The conditions are as follows:-
First 20 questions will belong to set 1, next 20 questions will belong to set2 and so on .....
So, i need to shuffle the data so that every 20 questions from top will contain 5 Java Ques, 8 DataBase, 5 .Net, 2 Subjective Questions. And the questions should be in arranged in random order. i.e. if the 1st ques is from JAVA , then 2nd ques should not be from JAVA, it should be from other subject. So, two subjects should not be together.
|Hi I need a sql query. My requirement is as follows|
I have a table containing the three subject marks of a student column named as maths,physics, chemistry
From that three columns,I need to find the highest and lowest marks of a student and I want a query to Display the Student's Highest and Lowest marks along with the subjects.
Can anyone help me to complete this task
|how to fetch data from database whan select start date to end date and minumum price to maximum price than show the data|
|You can sue start date and end date by using date between query , then add AND to it and give maximum price and minimum price. |
SELECT * FROM dt_tb WHERE dt BETWEEN '2014-4-2' AND '2014-4-18' and price BETWEEN max_price and min_price
|How to get the firstday and lastday salary difference|
|hi..i m doing mini project of internal mark calculation...i finished half of the project...but calculation part is remaining...will u pls help me!!!!the concept behind this project is...i have unit test1,2,3 and model exam1 from these i have to add best 3 examination marks with assignment and innovative mark...pls help me!!!|
|How does one get the highest (or last) numerical value from a column called ID in a table called PROPERTY|
|I WANT TO DISPLAY RANK OF STUDENTS ACCORDING TO THEIR SCORES AND BRING OUT THE 1ST, 2ND, 3RD.......POSITIONS |
|I want to display rank of student according to their CGPA and also wand to give if 2 student get same CGPA then i have to give same rank to both...|
|HOW TO RETRIEVE HIGEST VALUES FROM 1000 NUMBER|