13,665,306 members
See more:
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
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)

## 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!

## 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```

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 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.
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.

## 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.
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

Top Experts
Last 24hrsThis month
 ppolymorphe 140 OriginalGriff 135 Richard MacCutchan 55 Dirk Bahle 45 Gerry Schmitz 35
 OriginalGriff 3,877 Richard MacCutchan 1,542 ppolymorphe 1,462 Jochen Arndt 1,302 Dave Kreskowiak 843