简体   繁体   English

sql查询以检索数字和字母数字条目

[英]sql query to retrieve numeric and alphanumeric entries

Hi can anyone help with a quire to retrieve both numeric and alpha numeric entries from a column. 嗨,任何人都可以帮助查询从列中检索数字和字母数字条目。

Example: Column is 'ID' and entries could be = abc0000 or could be all 9999999999. 示例:列是“ID”,条目可以是= abc0000,也可以是全部9999999999。

The search is a list of numeric and alphanumeric items. 搜索是数字和字母数字项的列表。

Example: 8765398 ha34789 ss0487667 7629 示例:8765398 ha34789 ss0487667 7629

You could do: 你可以这样做:

SELECT * FROM table WHERE ID REGEXP '^[A-Za-z0-9]+$'

You could also use a named character : 您还可以使用命名字符

SELECT * FROM table WHERE ID REGEXP '^[[:alnum:]]+$'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM