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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T20:51:50+00:00 2026-06-06T20:51:50+00:00

I have a query I’ve been trying to make, it’s supposed to pull all

  • 0

I have a query I’ve been trying to make, it’s supposed to pull all rows that do not contain characters we do not want.

SELECT NID FROM NOTES WHERE NOTE LIKE '%[^0-9a-zA-Z#.;:/^\(\)\@\ \  \\\-]%'

That should return any rows that do not contain

0-9 a-z A-z . : ; ^ & @ \ / ( ) #

But any time i add one of these below it fails

$ [ ] ?

Even trying to escape them either by \ or [[ doesn’t seem to work properly. I only have access to stock SQL install.

  • 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-06T20:51:51+00:00Added an answer on June 6, 2026 at 8:51 pm

    it’s supposed to pull all rows that do not contain characters we do not want.

    To find rows that contain x you can use LIKE:

    SELECT * FROM yourtable WHERE col LIKE '%x%'
    

    To find rows that do not contain x you can use NOT LIKE:

    SELECT * FROM yourtable WHERE col NOT LIKE '%x%'
    

    So your query should use NOT LIKE because you want rows that don’t contain something:

    SELECT NID FROM NOTES WHERE NOTE NOT LIKE '%[0-9a-zA-Z#.;:/^\(\)\@\ \  \\\-]%'
    

    That should return any rows that do not contain

    0-9 a-z A-z . : ; ^ & @ \ / ( ) #
    

    No. Because of the ^ at the start, it returns the rows that don’t contain characters except those. Those characters you listed are the characters that are allowed.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have query that I run on Oracle that is supposed to allow hyphen
i have query that maybe haven't any element on sequence and i want to
I have query to show the table like this: but I want to PIVOT
I am using in C# MYsql .I have query that works if I run
I have query like that: (as You see I'd like to retrieve 50% of
Say I have 3 queries. Query 1 returns a piece of information that Query
I'm struggling. I have query against my db that returns a single column of
I've noticed that some sites (including the old http://careers.stackoverflow.com 1.0) have query strings that
I have query that gives back results like this: Client1 Product1 $500 Client1 Product2
Let's say I have query structured like below which indicates dates search.asp?date=091210 I want

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.