Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

simple sql question

Status
Not open for further replies.

iffoiffy

Programmer
Joined
Feb 24, 2005
Messages
67
Location
CA
Hi,

Suppose I have a field(A) in my table(Tab) which has a sentences like

"I work for a major company"


Now in my select statment I want to pick only those records where field "A" has word "major" in it..

How do i do that?

I thought there was some 'Any' operator ...


select * from Tab where A ?????????
 
Try:

Code:
SELECT * FROM Tab WHERE A LIKE "%major%"

The % wildcard represents a string of 0 or more characters.
 
thanks I will try that, but don't you think if i use
% on both ends then it will pick a record which may not have the exact word.

suppose I do it %GST%

it will pick the record that might have 'MGSTM'
 
thanks to everybody it works now
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top