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: Sunday, July 20, 2014 11:20 PM
Points: 5, Visits: 20
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: Yesterday @ 10:26 PM
Points: 218, Visits: 1,858
Try this.

select top 1 PRICE
from table1
order by price desc

Post #1548083
Posted Wednesday, March 5, 2014 11:57 PM
SSChasing Mays

SSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing Mays

Group: General Forum Members
Last Login: Monday, July 28, 2014 5:56 AM
Points: 632, Visits: 1,152
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