SQL Statement Problem.

Posted on 2008-10-21
Last Modified: 2012-05-05
Dear Expert,

I want to make a SQL statement to show the datas which is contain 'ab' but failed any one can help me?
Table Name: 123
Field Name: details

Select * from 123 where details LIKE '%ab%'

Am I correct ???
Question by:Rickyyy
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
LVL 143

Accepted Solution

Guy Hengel [angelIII / a3] earned 250 total points
ID: 22765625
this will work better:
sql server:
Select * from [123] where details LIKE '%ab%' 
ms access:
Select * from [123] where details LIKE '*ab*' 
Select * from `123` where details LIKE '%ab%' 
Select * from "123" where details LIKE '%ab%'

Open in new window


Author Comment

ID: 22765672
no record can found.....even have.....please help....
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 22765721
please clarify what database type you have, and what syntax you used.
are you SURE you connect to the right db?
Get Actionable Data from Your Monitoring Solution

Your communication platform is only as good as the relevance of the information you send. Ensure your alerts get to the right people every time with actionable responses. Create escalation rules that ensure everyone follows the process and nothing is left to chance.

LVL 13

Expert Comment

ID: 22765735
What database are you using?  This may seem obvious but I've made this error.  Have you verified the column with '%ab%' in it is the 'details' column?

Author Comment

ID: 22769564
i am using Access (mdb). And I confirm there having %ab% in the details columns....
LVL 13

Expert Comment

ID: 22769689
Can you send the file?

Author Closing Comment

ID: 31508190
The statement is work. Problem found which is come from the database problem.

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

If you find yourself in this situation “I have used SELECT DISTINCT but I’m getting duplicates” then I'm sorry to say you are using the wrong SQL technique as it only does one thing which is: produces whole rows that are unique. If the results you a…
This post looks at MongoDB and MySQL, and covers high-level MongoDB strengths, weaknesses, features, and uses from the perspective of an SQL user.
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

691 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