Re: Zero Values

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sep 1, 2015, at 10:36 PM, Ethan Rosenberg <erosenberg@xxxxxxxxxxxxxxxxxxxx> wrote:

> Dear List -
> 
> I have a payment/charges table -
> 
> mysql> describe Charges;
> +----------+----------------------+------+-----+---------+-------+
> | Field    | Type                 | Null | Key | Default | Extra |
> +----------+----------------------+------+-----+---------+-------+
> | Indx     | mediumint(9)         | NO   | PRI | 0       |       |
> | Cust_Num | smallint(5) unsigned | NO   |     | NULL    |       |
> | Balance  | decimal(10,2)        | YES  |     | NULL    |       |
> | Payments | decimal(10,2)        | YES  |     | NULL    |       |
> | Charges  | decimal(10,2)        | YES  |     | NULL    |       |
> | Notes2   | text                 | YES  |     | NULL    |       |
> | Date     | date                 | YES  |     | NULL    |       |
> | PH1      | char(4)              | YES  |     | NULL    |       |
> | PH2      | char(4)              | YES  |     | NULL    |       |
> | PH3      | char(5)              | YES  |     | NULL    |       |
> +----------+----------------------+------+-----+---------+-------+
> 10 rows in set (0.11 sec)
> 
> If Balance, Payments and Charges all equal 0, and then
> 
> select * from Charges,
> 
> the rows w/ all zero values will not be displayed.
> 
> Why?
> 
> TIA
> 
> Ethan
> 
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

I would recommend storing the zero value if you plan on using that value for calculation later. 
Just makes things easier than having to do a if(NULL) statement.
2¢

Best,

Karl DeSaulniers
Design Drumm
http://designdrumm.com
-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux