473,396 Members | 2,085 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

"LIKE" command of mysql for searching?

rahulephp
Hi there,
Could you please help me to find-out the solution?
I need to use "LIKE" command of mysql.

Below are title from a Product table. If i search for "Alarm" then it should show me result only for title which has word alarm. (0th and 2nd only)

table_name = product
Column_name = title
0 ->Casio G-Shock Velocity Indicator Alarm watch
1 ->Seiko Velatura Tachymeter Chronograph watch
2 ->Citizen promaster Alarm perpetual watch


Thank you in anticipation
Apr 22 '10 #1

✓ answered by Atli

Hey.

See 11.4.1. String Comparison Functions and 3.3.4.7. Pattern Matching in the manual.

In short, the % char is a wild-car char that can be used with the LIKE operator. You can add it at any point in the search phrase, so to search for any occurrence of a keyword in the given column, you would surround the keyword with the wild-card.

2 1745
Atli
5,058 Expert 4TB
Hey.

See 11.4.1. String Comparison Functions and 3.3.4.7. Pattern Matching in the manual.

In short, the % char is a wild-car char that can be used with the LIKE operator. You can add it at any point in the search phrase, so to search for any occurrence of a keyword in the given column, you would surround the keyword with the wild-card.
Apr 22 '10 #2
Hey thanks
I got the solution.

Below command gives all results having keywords Alarm or watch

Expand|Select|Wrap|Line Numbers
  1. SELECT * FROM product where title LIKE '%Alarm%' or '%watch%'
Apr 22 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Michael Flanagan | last post by:
Of course "echo" is working, but I've got a case where php doesn't seem to be sending out the result of an "echo." I'm probably doing something wrong, but I can't see it. I've got the following...
0
by: Bill Brinkworth | last post by:
I want the user to type in part of a word, and I want to return all words from an Access word table that contains specified letters. If they were to type "fe??", it should return all words in the...
4
by: Greg Stark | last post by:
I find myself wishing I had a syntax "LIKE ANY (array)". I don't see much value in the = ANY, = ALL, <> ANY, <> ALL syntax since they're equivalent more or less to IN and NOT IN. But it could be...
9
by: Peter | last post by:
My problem is the last bit of coding below, the like statement does not work. what I have is a product options field and in it is stored characters i.e. "avcy" etc what the query does is...
1
by: S. van Beek | last post by:
Dear reader, How can I filter a numeric field with Like as criteria in a query. To filter a numeric field with <10 as criteria this will com back with the result of those records for which...
7
by: Risen | last post by:
Hi,all, I want to execute SQL command " DROP DATABASE mydb" and "Restore DATABASE ....." in vb.net 2003. But it always shows error. If any body can tell me how to execute sql command as above?...
8
by: DQ dont quit | last post by:
I'm currently working on a ASP.Net / C# / SQL 2000 project that involves the entering of keywords, that a web user enters, and then searching MSWord documents for those words. This information...
25
by: samjnaa | last post by:
Please check for sanity and approve for posting at python-dev. In Visual Basic there is the keyword "with" which allows an object- name to be declared as governing the following statements. For...
4
by: JPG4 | last post by:
I have tried just about everything that I can think of, so now I turn to you all for help! I have created a form (titled "OAG") with an unbound textbox titled "DOW". I also have a Query that I...
3
by: veer | last post by:
Hi i want to make a program on searching which works fine but when the special characters came like "ö, ä it is not seaching these characters please give some idea reGArds varinder
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.