[步骤]
SELECT
'shopeev2',
a.SiteCode,
a.Sku,
a.SellerSku,
a.OrderSourceId,
a.DelType,
d.OrderSourceName AS 来源渠道,
a.FailureReason
-- COUNT( 1 ) AS '失败次数统计'
FROM
ap_autopublish_shopeev2_queue a
INNER JOIN sys_ordersource AS d ON a.OrderSourceId = d.OrderSourceId
WHERE
a.CustomerId = 1
and a.MarketId=97
AND `Status` = 'failure'
AND a.Time >'2023-07-13 00:00:00'
AND a.Time <'2023-07-14 00:00:00'
AND a.FailureReason LIKE'%渠道%'

-- Shopeev2指定失败原因查询
SELECT
'shopeev2',
a.SiteCode,
a.Sku,
a.SellerSku,
a.OrderSourceId,
a.DelType,
d.OrderSourceName AS 来源渠道,
a.FailureReason
-- COUNT( 1 ) AS '失败次数统计'
FROM
ap_autopublish_shopeev2_queue a
INNER JOIN sys_ordersource AS d ON a.OrderSourceId = d.OrderSourceId
WHERE
a.CustomerId = 1
and a.MarketId=97
AND `Status` = 'failure'
AND a.Time >'2023-07-13 00:00:00'
AND a.Time <'2023-07-14 00:00:00'
AND a.FailureReason LIKE'%shop reach item max limit%'

[结果]
DelType 为null,这个错误,应该标记为1[期望]
标记为1

1.
需求里面带有空格 但是shopeev2里面报错不带空格,按照需求的文字就匹配不到,现在将空格去掉。