By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,088 Members | 1,326 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,088 IT Pros & Developers. It's quick & easy.

query to return minimal product of two fields

P: n/a
To return a minimal price of a bottle of vodka stored in field "price" I
can call MIN function .

However this price ignores the size of the bottle.
Bottle types and sizes are stored in a different table called "Bottles"

Suppose I wanted to get a product with the minimal price per litre.
Obviously I have to multiply the bottle price by the bottle size.

Can I do it in one query which will fetch the minimal per/liter price?
Jul 19 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Yes,

Showing the exact field names in each table would help write the SQL.

--
-dlbjr

Discerning resolutions for the alms
Jul 19 '05 #2

P: n/a
Thanks,
I have been given a tip to do like this:

SELECT Min([PriceTable].[Price] / [Bottles].[SizeInLiters])
FROM [PriceTable] INNER JOIN [Bottles]
ON [PriceTable].[BottleID] = [Bottles].[BottleID];
"dlbjr" <do******@do.u> wrote in message
news:eV**************@TK2MSFTNGP10.phx.gbl...
Yes,

Showing the exact field names in each table would help write the SQL.

--
-dlbjr

Discerning resolutions for the alms

Jul 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.