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?
Major Incident Management Communications

Major incidents and IT service outages cost companies millions. Often the solution to minimizing damage is automated communication. Find out more in our Major Incident Management Communications infographic.

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

Industry Leaders: 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

PL/SQL can be a very powerful tool for working directly with database tables. Being able to loop will allow you to perform more complex operations, but can be a little tricky to write correctly. This article will provide examples of basic loops alon…
Composite queries are used to retrieve the results from joining multiple queries after applying any filters. UNION, INTERSECT, MINUS, and UNION ALL are some of the operators used to get certain desired results.​
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

732 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