简体   繁体   English

如何选择0作为前缀的值,例如00-09

[英]How can I select values with 0 as prefix e.g. 00-09

My column called 'abstract' varchar(2) utf8_general_ci has the following mixed values: 我的名为'abstract'varchar varchar(2) utf8_general_ci具有以下混合值:

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ... 98, 99,
00, 01, 02, 03, 04, 05, 06, 07, 08, 09,
A, B, C, D, E, F, G, ... X, Y, Z

How can I exclude the values 0-99 and AZ in an select query without explicit nomination. 如果没有明确的提名,如何在选择查询中排除值0-99AZ I do only need the values 00-09 . 我只需要值00-09 I tried the following query: 我尝试了以下查询:

select * from table where abstract REGEXP '[^0-99]' and abstract REGEXP '[^AZ]';

But the REGEXP '[^0-99]' removes also the 00-09 from result. 但是REGEXP '[^0-99]'也从结果中删除了00-09

这应该做:

  select * from table where abstract like "0%" and abstract != "0";

尝试这个:

select * from table where abstract like %'00-0'%;

暂无
暂无

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

相关问题 在两次之间搜索(例如14:00:00-16:00:00) - Search between two times (e.g. 14:00:00 - 16:00:00) 如何在PHP中使用Ajax从网站(例如IMDB)中获取数据 - How can I fetch data from a website (e.g. IMDB ) using Ajax in PHP 如何在Codeception帮助器中访问演员(例如AcceptanceTester) - How can I access an actor (e.g. AcceptanceTester) in a Codeception helper 如何使用PHP计算目录中的所有文件? (例如124个文件) - How can I count all files in a directory with PHP? (e.g. 124 Files) 如何在特定时间间隔内运行PHP脚本(例如每天一次)? - How can I run PHP script in certain interval (e.g. once a day)? 我如何以编程方式查看网站发出的请求(例如 API 或资源请求) - How can I programmatically see what requests (e.g. API or resource requests) are being made by a website 如何使用PHP仅选择一列时间(例如10:15、10:35),如何将其与当前时间进行比较? - How do I select only a column of times (e.g., 10:15, 10:35) using PHP and how can I compare those with the current time? 如何检查用户是否通过Google Adwords访问(例如,使用__utm * coockie)? - How can I check if a user came via Google Adwords (e.g. by using the __utm* coockie)? 如何对 SQL 查询进行排序,但将某些 UTF-8 字符排序为正常等效字符? (例如É被视为E等) - How can I sort an SQL query but have certain UTF-8 characters be ordered as their normal equivalent? (e.g. É be regarded as E etc) 只有年份的日期(例如1570-00-00) - Dates where only year is known (e.g. 1570-00-00)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM