删除包含中文的 和不饱和中文的字段
SHOW create table pages;
drop table if exists `film`;
CREATE TABLE `film` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=484 DEFAULT CHARSET=utf8;
insert into `film` (name) values(‘1111113ggfh2‘);
insert into `film` (name) values(‘113ggfh2风险‘);
insert into `film` (name) values(‘[email protected]‘);
insert into `film` (name) values(‘[email protected]风听听‘);
delete from `film` where length( name ) = CHARACTER_LENGTH( name );--删除不包含中文的
delete from `film` where length( name ) = CHARACTER_LENGTH( name );--删除包含中文的
select * from `film`;
另一种方法是正则 http://blog.itpub.net/703656/viewspace-1043366/
时间: 2024-10-15 17:53:50