From: Sasha Pachev Date: March 12 1999 4:34pm Subject: Re: MySQL and NULL entires List-Archive: http://lists.mysql.com/mysql/87 Message-Id: <36E94200.87C7B7DB@direct1.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mike Machado wrote: > > I did an alter table to add a column called billgroup as an int(10) > > This worked ok and it set all the existing rows to have "NULL" in the > new column. So I figured I would do a mass update to switch it then to > "1". These are the statements I executed but did not seem to change > anything: > > select billgroup from account limit 10; > > +-----------+ > | billgroup | > +-----------+ > | NULL | > | NULL | > | NULL | > | NULL | > | NULL | > | NULL | > | NULL | > | NULL | > | NULL | > | NULL | > +-----------+ > 10 rows in set (0.01 sec) > > update account set billgroup = "1" where billgroup = "NULL"; > update account set billgroup = "1" where billgroup = NULL; > update account set billgroup = "1" where billgroup = ""; > update account set billgroup = "1" where billgroup = ''; > update account set billgroup = "1" where billgroup = "0"; > update account set billgroup = "1" where billgroup is NULL; is, not = will do the job > -- Sasha Pachev http://www.sashanet.com