Solved

find words LIKE "some letters" query MySql

Posted on 2013-02-07
2
366 Views
Last Modified: 2013-02-07
I have in MySql database for example this terms:
1. Techniker
2. Bautechniker
3. Weintechnologe

I need query that will display all results that contain letters that user types.
For example if someone types letter "t" it should give all results that have letter t anywhere in the word. That means all three results given above as example.

If someone types letters "te" or "tec" or "tech" or "techn" it should give all three results above given as example.

If someone types letters "techni" it should give results 1 and 2.

If someone types letters "techno" it should give result 3. etc.

Thank you for any help
0
Comment
Question by:mankis
2 Comments
 
LVL 6

Accepted Solution

by:
esolve earned 500 total points
ID: 38864312
SELECT * FROM Table WHERE Column LIKE '%SearchPhrase%'

or

DECLARE @Param VARCHAR(50)
SET @Param = '%te%'

SELECT * FROM Table WHERE Column LIKE @Param

or

SELECT t1.Notes,
       t2.Name
  FROM Table1 t1
  JOIN Table2 t2 ON t1.Notes LIKE CONCAT('%', t2.Name ,'%')

or

http://www.mysqltutorial.org/sql-like-mysql.aspx
0
 

Author Comment

by:mankis
ID: 38864371
I just realized I asked wrong question but your solution is correct for what I asked so I will close question and give you the points. Thank you.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Loading csv or delimited data files to MySQL database is a very common task frequently questioned about and almost every time LOAD DATA INFILE comes to the rescue. Here we will try to understand some of the very common scenarios for loading data …
Creating and Managing Databases with phpMyAdmin in cPanel.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

758 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

18 Experts available now in Live!

Get 1:1 Help Now