Hey list;

I have a case where I need to fetch a product row from a table
containing price information about some products, and where every
product can have multiple rows but from different suppliers (thus with
different prices and stock information).

However, I'm trying to create a query which fetches the row matching a
product from the supplier with the best price, but where the stock is
0. If none of the suppliers has the item in stock, it should get the
row with the highest price of them all.

Is this possible with a SQL query, or do I need to fetch all rows for
the product and then process it with my programming language of
choice? :-)

Best Regards
--
Kim Christensen

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to