Simple Sorting into a single table
Posted by:
Antonio Catano ()
Date: November 03, 2009 08:33AM
Hi to everybody,
I'm new into MySQL, I like it but I have a lot to learn. In trying to learn and understand making exercise I found a problem, very hard for me to believe that it's happen. Let me explain.
I have a single table, let's say with 5 columns. Inside of this table I have 10 records or more. Now I want to sort the table having one column (let's say 'price' column) with max values in desc order.
It was easy, but all the other columns doesn't changed in order to correspond to my 'price' column at each record. Resulting prices for different products than original.
The script line is:
SELECT max(price) AS maxim, products, customers, date FROM wherehouse WHERE products='pen' ORDER BY maxim DESC;
How it is possible if my original table having maximum price in table for pen at date 2009-10-11, after sorting to have different corresponding date to my value? Why each record don't keep column linked to have corresponding data. What the mistake?
thank you,
Sorry, only registered users may post in this forum.
© 1995-2008 MySQL AB, 2008- Sun Microsystems, Inc.