Try this...

SELECT Image1, Description
FROM cars
WHERE rating = (SELECT MAX(rating) FROM cars)

HTH,

Jeff Garza

-----Original Message-----
From: Chad [mailto:cgray@;careyweb.com] 
Sent: Sunday, November 03, 2002 8:54 AM
To: CF-Talk
Subject: Query help


I know I have done this in the past, but I cannot figure it out for some
reason.  

I want to grab out of a database the record with the highest value for
the field RATING (it is an INT).  I also want to grab all the data for
the record like Image1, Description etc....


SELECT MAX(RATING), Image1, Description
FROM cars
WHERE approved = 1

Something is very wrong with my select statement.. I cant figure out if
I have to do a MAX(RATING) AS MaximumRATING, Image1, Description...


Need more coffee!



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.

Reply via email to