Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6880097
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:55:50+00:00 2026-05-27T04:55:50+00:00

In an SQL table I have following columns id, title, content And I would

  • 0

In an SQL table I have following columns

id, title, content

And I would like to search text inside title or content having “[” or “]“.

What will be the SQL command to fetch such kind of data?

(edit: removed “efficient”)

(added)
As per “rsbarro”

I have tried and my findings are:

If I try for

SELECT * FROM MyTable WHERE Title LIKE '%[%'

returns 0 row.

If I try for

SELECT * FROM MyTable WHERE Title LIKE '%]%' 

returns number of rows.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T04:55:51+00:00Added an answer on May 27, 2026 at 4:55 am

    The examples above are failing for like matching because LIKE offers a single character match option with [].

    Any single character within the specified range ([a-f]) or set ([abcdef]).
    

    To actually match a [, you will need to embed it in a pair of brackets

    ;
    WITH DEMO (Title) AS
    (
        SELECT 'Where are you [ I am here]'
        UNION ALL SELECT 'WHO ARE YOU'
        UNION ALL SELECT 'asdafasfa][asdfadfasdfasdfa'
    )
    SELECT 
        D.* 
    FROM 
        DEMO D 
    WHERE 
        D.Title LIKE '%[[]%' 
        OR D.Title LIKE '%[]]%'
    

    Returns

    Where are you [ I am here]
    asdafasfa][asdfadfasdfasdfa
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In a SQL Server table I have the following 2 columns: RowId : primary
I have a table in SQL Server that contains the following columns : Id
I have the following table in SQL Server 2000: TABLE_NAME | COLUMN_NAME | TYPE_NAME
I have a sql table which have the following data, Id City Country ---
I have the following SQL table - Date StoreNo Sales 23/4 34 4323.00 23/4
I have the following SQL table: A|B --- w|x x|w y|z z|y Can I
I have the following example in a SQL table Cust Group Sales A 1
I have the following pseudo-SQL schema: table flight id int primary key date timestamp
I have a table defined by the following SQL: CREATE TABLE test ( id
I have the following table variable in SQL Server 2005: DECLARE @results TABLE (id

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.