Click here to Skip to main content
13,192,207 members (32,175 online)
Rate this:
 
Please Sign up or sign in to vote.
Price Age Name
3000 30 Ram
2000 20 Ram
1000 10 Ram
5000 40 Sham
6000 50 Sita

Write a Sql query and display output as

Price Age Name
1000 30 Ram
5000 40 Sham
6000 50 Sita


What I have tried:

Please write sql query code for above program
Posted 9-Sep-17 10:29am
Updated 10-Sep-17 0:34am
Comments
kmoorevs 9-Sep-17 16:48pm
   
This one's about grouping and aggregates. hint: min and max
an0ther1 13-Sep-17 0:37am
   
Run the following query;
SELECT
CHAR(68) + CHAR(111) + CHAR(32)
+ CHAR(121) + CHAR(111) + CHAR(117)
+ CHAR(114) + CHAR(32) + CHAR(79)
+ CHAR(87) + CHAR(78) + CHAR(32)
+ CHAR(104) + CHAR(111) + CHAR(109)
+ CHAR(101) + CHAR(119) + CHAR(111)
+ CHAR(114) + CHAR(107)
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.

Try it yourself, you may find it is not as difficult as you think! This isn't difficult: all you need to do is think, and use GROUP BY and MAX/MIN

If you meet a specific problem, then please ask about that and we will do our best to help. But we aren't going to do it all for you!
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

Before anything else, you need to find the rule that allow you to transform this data:
Price Age Name
3000 30 Ram
2000 20 Ram
1000 10 Ram

to this result:
Price Age Name
1000 30 Ram

This site will help you to learn SQL: SQL Tutorial[^]
Quote:
Write a Sql query and display output

We do not do your HomeWork.
HomeWork is not set to test your skills at begging other people to do your work, it is set to make you think and to help your teacher to check your understanding of the courses you have taken and also the problems you have at applying them.
Any failure of you will help your teacher spot your weaknesses and set remedial actions.
Any failure of you will help you to learn what works and what don't, it is called 'trial and error' learning.
So, give it a try, reread your lessons and start working. If you are stuck on a specific problem, show your code and explain this exact problem, we might help.
  Permalink  
Comments
0x01AA 10-Sep-17 7:23am
   
It Looks like somebody hunt you :doh: some corrections
ppolymorphe 10-Sep-17 7:36am
   
Yes 3 downvotes in a row :)
Thank you very much, once again.
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 3

I tried using min/max and group by clause but couldnt get the desired output. So if you know Please provide the exact sql query.
Thanks in advance
  Permalink  
Comments
0x01AA 10-Sep-17 7:56am
   
1. This is not an answer. Better remove it to prevent from downvotes
2. "I tried using min/max and group by clause but couldnt get the desired Output"
Show your SQL in the question
3. "Please provide the exact sql query"
That makes no sense. If you get the solution on the silver tablet you will not learn anything

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy |
Web02 | 2.8.171017.2 | Last Updated 10 Sep 2017
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100