List:General Discussion« Previous MessageNext Message »
From:Jenny Lim Date:March 15 1999 3:16am
Subject:SELECT MAX() or SUM() always returns zero
View as plain text  
Submitter-Id:  Jenny Lim
Originator:    Root
Organization:  Other Music, Inc.
MySQL support: email support
Synopsis:      SELECT MAX() or SUM() always returns Zero
Severity:      serious
Priority:      high
Category:      mysql
Class:         support
Release:       mysql-3.21.32a (Source distribution)

Environment:

System: Linux www.othermusic.com 2.0.34 #1 Fri Aug 28 19:39:04 PDT 1998
mips un\
known
Architecture: mips

Some paths:  /usr/bin/perl /usr/bin/make /usr/bin/gmake /usr/bin/gcc
/usr/bin/c\
c
GCC: Reading specs from /usr/lib/gcc-lib/mipsel-linux/2.7.2/specs

Class:         support
Release:       mysql-3.21.32a (Source distribution)

Compilation info: CC='gcc'  CFLAGS='-O2'  CXX='gcc'  CXXFLAGS='-O2'
LDFLAGS='-\
static'

Perl: This is perl, version 5.004_04 built for mips-linux

Description:
I have a field CATALOG_ID in table OM_Catalog which is defined as
INT.  When I execute the statement "select MAX(CATALOG_ID) FROM
OM_Catalog", I always get zero even if I have records containing
catalog id's in the table..

+-----------------+
| max(catalog_id) |
+-----------------+
|               0 |
+-----------------+
1 row in set (0.74 sec)

I have another DECIMAL(12,2) field
called total_price in table OM_Order_Header, when I execute
select SUM(total_price) FROM OM_Order_Header, it also always returns
zero even if there are orders in the table with prices in them.

+------------------+
| sum(total_price) |
+------------------+
|             0.00 |
+------------------+
1 row in set (0.01 sec)

Please advise immediately...I have consulted all the
manuals/documentation already, and I've used SQL extensively...
I've never encountered such a problem before.

- Jenny

Thread
SELECT MAX() or SUM() always returns zeroJenny Lim15 Mar
  • SELECT MAX() or SUM() always returns zerosinisa16 Mar