today I am facing a new problem, maybe due to a black out. I am trying to select from a table based on the results from a select statement, however, the result only contains the first few characters of the field.
The main table has the field "category" which contains e.g. "Accessories for".
The referring table has a field "category_group" which contains e.g. "Accessories".
I have written a Select statement as following
SELECT id FROM main_table WHERE category = (SELECT category_group FROM reffering_table WHERE category_group = 'Accessories');
This of course there are no results, as the main_table has no such content. I would like to place a like inside this select statement, so that it would work. I thoght about
SELECT id FROM main_table WHERE category LIKE 'Accessories%';
This query works perfectly. How can I place 'Accessories%' into a SELECT statment? Something like
SELECT id FROM main_table WHERE category LIKE "(SELECT category_group FROM reffering_table WHERE category_group = 'Accessories')%";
I appreciate your replies.