1

I am having trouble matching strings in MySQL. I have the following:

SELECT ea.* 
FROM epf_application ea 
    JOIN epf_application_device_type ead ON ea.application_id = ead.application_id
    JOIN epf_device_type edt ON ead.device_type_id = edt.device_type_id 
WHERE 
    edt.name = 'someDevice'
LIMIT 30 

I would like to filter the above results even further by adding ea.title='%tele%' to the above sql statement like the following

SELECT ea.* 
FROM epf_application ea 
    JOIN epf_application_device_type ead ON ea.application_id = ead.application_id
    JOIN epf_device_type edt ON ead.device_type_id = edt.device_type_id 
WHERE 
    edt.name = 'someDevice' AND ea.title='%tele%'
LIMIT 30 

The above sql statement doesn't return anything, however when I do the following I get a result.

SELECT ea.* 
FROM epf_application ea 
    JOIN epf_application_device_type ead ON ea.application_id = ead.application_id
    JOIN epf_device_type edt ON ead.device_type_id = edt.device_type_id 
WHERE 
    edt.name = 'someDevice' AND ea.title='television'
LIMIT 30 

Any suggestions on what I might be doing wrong?

2 Answers 2

3

Change it to

ea.title LIKE '%tele%'
Sign up to request clarification or add additional context in comments.

1 Comment

I can't believe I missed that. Thanks
2

I believe you want LIKE

ea.title LIKE '%tele%'

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.