美文网首页
2019-04-19

2019-04-19

作者: 幻无虚生 | 来源:发表于2019-04-19 16:50 被阅读0次
进行OR匹配
SELECT prod_name FROM products WHRER prod_name REGEXP '1000|2000' ORDER BY prod_name;
匹配几个字符之一
SELECT prod_name FROM products WHERE produ_name REGEXP '[123] Ton' ORDER BY prod_name;
匹配特殊字符
SELECT vend_name FROM vendors WHERE vend_name REGEXP '.' ORDER BY vend_name;

转义

SELECT vend_name FROM vendors WHERE vend_name REGEXP '\\.' ORDER BY vend_name;
匹配多个实例
SELECT prod_name FROM products WHERE prod_name REGEXP '[[:digit:]]{4}' ORDER BY prod_name;

定位符

SELECT prod_name FROM products WHERE prod_name REGEXP '^[0-9\\.]';

拼接字段

Concat()

SELECT Concat (vend_name , '(',vend_country,')' FROM vendors ORDER BY vend_name;

相关文章

网友评论

      本文标题:2019-04-19

      本文链接:https://www.haomeiwen.com/subject/zybqgqtx.html