I have been searching for a query to compare values in single rows in the same table.
我一直在搜索一个查询来比较同一个表中单行的值。
Example table:
SKU Description SKU Category
173406926 Widgets 1734
137406927 Widgets-Blue 1734
I need to find the rows where the SKU number does not start with the SKU Category number (as in row two above)
我需要找到SKU编号不以SKU类别编号开头的行(如上面第二行所示)
3 个解决方案
#2
0
You can try this-
你可以尝试这个 -
SELECT * from tblName where SKU number REGEXP '^SKU Category'
SELECT * from tblName其中SKU编号REGEXP'^ SKU类别'
#3
0
select sku from tablename t where not (sku like concat(`sku category`, '%'))
Try that...
#1
#2
0
You can try this-
你可以尝试这个 -
SELECT * from tblName where SKU number REGEXP '^SKU Category'
SELECT * from tblName其中SKU编号REGEXP'^ SKU类别'
#3
0
select sku from tablename t where not (sku like concat(`sku category`, '%'))
Try that...