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 7806749
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T02:37:59+00:00 2026-06-02T02:37:59+00:00

Consider the following messages: id message ———————————————————— 1 $AA is the only way to

  • 0

Consider the following messages:

id  message
------------------------------------------------------------
1   $AA is the only way to go!
2   This is my $AA. There are many like it.
3   But this is my $AA.
4   My$AA is my swag.
5   For lack of imagination a message with $AA in the middle.
6   Another message with at the end: $AA

I want to filter all messages with $AA:

  • $AA could be at the beginning of the message (so: only a space after it)
  • $AA could be at the end of a message (so: only a space before it)
  • $AA could be anywhere else in the message (surrounded by spaces)
  • $AA could have punctuation before and/or after it: $AA. $AA, or ($AA)
  • But not any other charachters (letters and numbers)

I would normally use a query such as

SELECT * FROM messages WHERE message LIKE '%$AA%'

But then message 4 is also returned. How can I made the query not return message 4?

  • 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-06-02T02:38:01+00:00Added an answer on June 2, 2026 at 2:38 am

    It’s too easy just add a space in your query like this-

    SELECT * FROM table_name WHERE messages LIKE '% $AA%'
    

    This will not cover first row for that

    use this:

    SELECT * FROM table_name WHERE messages LIKE '% $AA%' or messages like '$AA%'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Consider the following messages table: _date message ------------------------- 2012-02-22 hello 2012-02-22 another msg! 2012-03-05
Consider the following database tables: Table messages with 13,000,000 rows (one row per message).
Consider the following code: public ObservableCollection<Message> Messages { get { return new ObservableCollection<Message>(); }
Consider the following code: std::string my_error_string = Some error message; // ... throw std::runtime_error(std::string(Error:
consider following: 1st APPROACH: public void f3() { f2(); f1(); } and this ...
Consider the following method: /** * Set whether messages are printed to System.out. *
Recently I stumbled across a strange (to me) compiler error message. Consider the following
Consider the following Python script, which uses SQLAlchemy and the Python multiprocessing module. This
Consider the following tables: users messages ------------------- ---------------------- user_id avg_quality msg_id user_id quality -------------------
Please consider the following scenario in BizTalk 2006: Received message should be routed to

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.