LIKE
演算子を文字列検索に使用するには、どのように文字列が別のselect文の出力として出力されますか?私たちはそのための入力として選択クエリを持つ演算子を持つことができますか?
SELECT CONCAT('"id":"',transactions.Id,'"') AS id
FROM transactions.transactions LEFT JOIN
report.PlayerTransaction
ON (transactions.Id=PlayerTransaction.TranId)
WHERE TranId IS NULL AND transactions.created_at > '2017-10-15' ;
SELECT *
FROM report.EtlServiceErrorLog
WHERE Topic = 'player' and ErrorSourceData like xxxx and
CreatedDate > '2017-10-15' ;
これらの2つのクエリを考慮します。クエリを次のように記述したいとします。
SELECT *
FROM report.EtlServiceErrorLog
WHERE Topic = 'player' and
ErrorSourceData like in (SELECT CONCAT('"id":"', transactions.Id, '"') AS id
FROM transactions.transactions LEFT JOIN
report.PlayerTransaction
ON (transactions.Id = PlayerTransaction.TranId) WHERE TranId IS NULL AND transactions.created_at > '2017-10-15'
;) and
CreatedDate > '2017-10-15' ;
またはループするための助けが必要ですか?私に例を教えてください。
'LIKE'が、私は' CONCAT(でワイルドカードを見ないのはなぜ。。? ' "ID": "'、transactions.Idを、 '' ') '。LIKE'パターンマッチングのためのものである。 'col LIKE 'ABC%''。 'col LIKE 'ABC'は比較ではほとんど意味がなく、' col = 'ABC'と書く方がよいでしょう。 –
ErrorSourceDataには文字列として格納された巨大なjsonデータが含まれています。それはそこで使用されているような理由です –