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, September 2, 2014 11:51 PM
Points: 5, Visits: 21
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: Today @ 12:27 AM
Points: 227, Visits: 2,018
Try this.

select top 1 PRICE
from table1
order by price desc

Post #1548083
Posted Wednesday, March 5, 2014 11:57 PM
Right there with Babe

Right there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with Babe

Group: General Forum Members
Last Login: Thursday, September 18, 2014 4:13 AM
Points: 747, Visits: 1,315
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