SELECT ProductNumber, Name, ListPrice
FROM SalesLT.Product
WHERE ProductNumber LIKE 'BK-[^R]%-[0-9][0-9]';'BK-M47B-38'
我想要的产品是:start with 'BK-' followed by any character other
than 'R', and ends with a '-' followed by any two numerals
。
以上是ms-sql
查询,我想要此查询的 mysql 版本
productNumber如下:
'BK-M47B-40'
'BK-M82B-44'
'FR-R38B-60'
'ST-9828'
答案 0 :(得分:1)
使用function add_custom_script(){
?>
<script>
(function($){
$(window).load(function() {
$('a[data-filter=".sparmenue"]').trigger('click');
});
})(jQuery);
</script>
<?php
}
add_action('wp_footer', 'add_custom_script');
RLIKE:
的 SqlFiddleDemo
强>
答案 1 :(得分:1)
等效的正则表达式非常相似:
SELECT ProductNumber, Name, ListPrice
FROM SalesLT.Product
WHERE ProductNumber REGEXP '^BK[-][^R].*[-][0-9]{2}$'
主要差异:
^
和$
标记字符串的开头和结尾(否则,正则表达式会匹配字符串中的任何位置。%
- &gt; .*
[:digit]
,但输入的时间会更长。