Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

SQL Query Expand / Collapse
Author
Message
Posted Wednesday, March 5, 2014 10:00 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, November 4, 2014 6:53 AM
Points: 5, Visits: 23
Please help me in doing this exercise.

ItemID ItemName Price
1 Item1 120.00
2 Item2 234.00
3 Item3 250.00
4 Item4 300.00
5 Item5 300.00
6 Item6 290.00
7 Item7 170.00
8 Item8 90.00
9 Item9 170.00

the above is the existing table
and i need a query to retrieve max price with out using max function and sub query

Target is to write SQL statement within 60 characters.
Post #1548075
Posted Wednesday, March 5, 2014 11:30 PM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Monday, November 10, 2014 5:31 PM
Points: 238, Visits: 2,221
Try this.

select top 1 PRICE
from table1
order by price desc

Post #1548083
Posted Wednesday, March 5, 2014 11:57 PM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Friday, December 19, 2014 3:33 AM
Points: 856, Visits: 1,506
looks like an assignment question to me
Post #1548086
Posted Wednesday, March 26, 2014 12:57 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, June 4, 2014 11:13 PM
Points: 4, Visits: 6
Select top 1 price from table_name order by price desc
Post #1554793
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse