Jump to content

Select using LIKE


suttercain

Recommended Posts

Hi everyone,

 

I currently am running the following select statement:

 

SELECT * FROM device
				INNER JOIN device_eo ON (  device.device_id = device_eo.device_id )
				INNER JOIN eo ON ( device_eo.executive_order = eo.executive_order )
				INNER JOIN eo_engine_family ON ( eo.executive_order = eo_engine_family.executive_order )
				INNER JOIN engine_family ON ( eo_engine_family.engine_family_name = engine_family.engine_family_name )
				WHERE eo.executive_order LIKE '%".$r."%'

 

But I am not getting the results I seek. The executive order appears in a string format that is in the following format:

 

DE-05-01

DE-05-001-01

DE-05-001-02

DE-06-001

DE-06-001-01

DE-06-001-02

 

If I do a search for DE-06-001-01 I would like these results returned:

DE-06-001

DE-06-001-01

DE-06-001-02

 

As it currentley stands I would only output DE-06-001-01

 

What am I doing wrong here? Thanks in advance.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.