Solved

SQL query syntax with WHERE and '%[ABC' clause

Posted on 2016-10-05
1
30 Views
Last Modified: 2016-10-05
I am trying to write a WHERE clause where the query returns and rows having the title containing the string '[ABC]'.  Users have included the brackets to identify specific rows but this contradicts the wildcard %.  Can I use ESCAPE?
0
Comment
Question by:szadroga
1 Comment
 
LVL 69

Accepted Solution

by:
Éric Moreau earned 500 total points
ID: 41830604
LIKE '%[[]ABC[]]%' 

Open in new window

or
LIKE '%\[ABC\]%' ESCAPE '\'

Open in new window

1

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

'Between' is such a common word we rarely think about it but in SQL it has a very specific definition we should be aware of. While most database vendors will have their own unique phrases to describe it (see references at end) the concept in common …
Confronted with some SQL you don't know can be a daunting task. It can be even more daunting if that SQL carries some of the old secret codes used in the Ye Olde query syntax, such as: (+)     as used in Oracle;     *=     =*    as used in Sybase …
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now