MySql insert from one table to another where a field not null -


i have table "phonebook" has 1.5m records, of records have "phonenumber" field empty.

i want copy records "phonenumber" field not empty table. due seems simple, cant work.

here code:

insert phonebook2 (company,zip,city,address,tags,phonetype,phonearea,phonenumber) select company,zip,city,address,tags,phonetype,phonearea,phonenumber phonebook phonenumber != null && phonenumber != ""; 

i dont error, "0 rows affected". in manual search on records, see null values phonenumber.

any suggestions ?

** have tried running same query without part , transfer records should.

use is not null instead of != null.

source: mysql manual


Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -