Solved

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

Posted on 2016-10-05
1
46 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 70

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SSRS 2012 r2 - Parm Drop Down has Date/Time 12 30
SQL Insert parts by customer 12 31
T-SQL: "HAVING CASE" Clause 1 23
MS SQL + Insert Into Table - If Doesnt Exist 9 32
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 …
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

813 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

10 Experts available now in Live!

Get 1:1 Help Now