添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

I want to seach for user whose address field contains digits.

I tried the following sql statement in MySQL Workbench:

SELECT * FROM user WHERE address LIKE '%[^0-9]%';

However, it did not work. Can anyone help me out here?

Thanks in advance.

thanks. got it=) but this is strange... when i tried my sql statement in w3schools.com/sql/trysql.asp?filename=trysql_select_like, it worked. – Jia-Luo Jun 5, 2013 at 23:02 @user1140210: % isn't a regex character, it's a wildcard. Almost like s* when searching for file, SQL's equivalent would be s%. And althought LIKE can accept certain things that are similar to regex patterns, it's not true regex (that's where REGEXP comes in). – Brad Christie Jun 5, 2013 at 23:06

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.