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
  • 3
  • 2
  • 2
LVL 142

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 142

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?
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

In database programming, custom sort order seems to be necessary quite often, at least in my experience and time here at EE. Within the realm of custom sorting is the sorting of numbers and text independently (i.e., treating the numbers as number…
Confronted with some SQL you don't know can be a daunting task. It can be even more daunting if that SQL carries some of the old secret codes used in the Ye Olde query syntax, such as: (+)     as used in Oracle;     *=     =*    as used in Sybase …
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

743 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now