Jump to content

Content without number


OldMan

Recommended Posts

 

Perhaps he means a query using LIKE?

 

http://www.w3schools.com/sql/sql_like.asp

 

http://www.w3schools.com/sql/sql_wildcards.asp

SELECT * FROM table1WHERE col1 NOT LIKE '%[0-9][0-9][0-9][0-9]';

 

Thanks, but don't work correctly.. my content is similar to this:

1º field - 2013, Jonh, Mickey, Max2º field - Mix, 1989, Software, games
Edited by OldMan
Link to comment
Share on other sites

You might experiment with the use of _ rather than %. The underscore is supposed to represent one character while % is supposed to represent 0-to-many characters.

 

http://dev.mysql.com/doc/refman/5.5/en/string-comparison-functions.html#function_strcmp

I tried:

 

select * from table WHERE col NOT LIKE '1%%%' AND col NOT LIKE '2%%%';
select * from table WHERE col NOT LIKE '%1___%' AND col NOT LIKE '%2___%';
return the same result

SELECT * FROM table WHERE col NOT REGEXP '[0-9]{4}'

 

Idk why, but don't show any result.

Link to comment
Share on other sites

Sounds like there aren't any records that don't have a 4-digit number somewhere in them. When I run that on my database it works to exclude any record that has a sequence of 4 digits.

yes, working...i tried in wrong column.

 

Thanks 4 all.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...