
December 3rd, 2004, 06:13 AM
|
|
Registered User
|
|
Join Date: Apr 2004
Location: California
Posts: 27
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
help with MAX function ?
I have the following problem statement:
Quote: | What was the most expensive merchandise item sold in July? Display sale date, sale price and merchandise description. Sort output by descending sales price. (hard-coding date is OK). |
Here's my query statement:
Code:
SELECT saleDate AS "Sale Date",
salePrice AS "Sale Price",
description AS "Merchandise Description"
FROM Sale, SaleItem, Merchandise
WHERE salePrice
AND DATENAME(MONTH, dateBorn) = 'July'
ORDER BY salePrice DESC
I want to know how I would use the MAX function on my query since I know this would give me the most expensive item. Am I writing my query statement correctly? Do I have to declare the MAX function in the SELECT statement and on the WHERE statement of just on the WHERE statement? Any clarifications/help would be appreciated 
|