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
https://forums.phpfreaks.com/topic/129824-select-using-like/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.