I have a TransactionDetails
table with TransactionId
, TransactionDetail
columns, those are used to track all the transactions within the application.
The sample records of the TransactionDetail are:
[Blah][Log] 20 Records Inserted
[Blah][Exception] Fails on INSERT INTO
[Blah][Error] Authentication Fails Logged
[Blah][Warning] Null value is eliminated by an aggregate
[Blah][Log] 10 Records Deleted
I want to filter the TransactionDetail columns having the [Log] only (The Log, Logged keyword also exist in the other rows). The search query with []
consider as regular expression pattern. How can I skip that and get the required details only.
I have tried the \
escape character in front of the [
, ]
, but it doesn't return any result.
SELECT *
FROM TransactionDetails
WHERE TransactionDetail LIKE '%\[Log\]%'
Expected result:
[Blah][Log] 20 Records Inserted
[Blah][Log] 10 Records Deleted
SQL Fiddle: http://sqlfiddle.com/#!3/d69f3d/1