You might want to add an ORDER BY clause.
Sommai Fongnamthip wrote: > Hi, > did someone tell me why group by clause not work? I'd like to group > volume of order from my customer at the same price and my supplier. > here is my code > > Select custid, symbol, sum(volume) as sumvol, price, mktid, > supplier, supplierflag > From confirm > WHERE mktid=123 or mktid=456 > Group by custid, symbol, supplier, supplierflag, price > I got this: > > row# custid symbol sumvol price mktid supplier > supplierflag > (char) (char) (int) (double) (char) > (char) (char) > 1 1234 XXX 100 12 123 1 C > 2 1234 XXX 150 12 123 2 C > 3 1234 XXX 200 13 123 1 E > Why row 3 not follow data in row 1 instead of row 2? How could I > correct my SQL statement? > > SF > > > --------------------------------------------------------------------- > Before posting, please check: > http://www.mysql.com/manual.php (the manual) > http://lists.mysql.com/ (the list archive) > > To request this thread, e-mail <[EMAIL PROTECTED]> > To unsubscribe, e-mail > <[EMAIL PROTECTED]> > Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php -- Gerald L. Clark [EMAIL PROTECTED] --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php