suttercain Posted October 23, 2008 Share Posted October 23, 2008 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 More sharing options...
Barand Posted October 23, 2008 Share Posted October 23, 2008 use ... LIKE 'DE-06-001%' Link to comment https://forums.phpfreaks.com/topic/129824-select-using-like/#findComment-673072 Share on other sites More sharing options...
suttercain Posted October 25, 2008 Author Share Posted October 25, 2008 Thanks Barand. I'll give it a go on Monday when I'm back in the office. Link to comment https://forums.phpfreaks.com/topic/129824-select-using-like/#findComment-674510 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.