How should this SQL statement be modified?
SQL Code
Select si.user_id from Ecs_store_info as Si WHERE si.store_name like (SELECT wl.store_name from Ecs_wpaqq_log as WL where Wl.lngshopid=0)
is how to use the SELECT statement after the like key
------Solution--------------------
LZ idea I generally understand, but like is fuzzy match a string of characters. LZ if you want to be in a lot of characters, random fuzzy match any one, can only use in or through PHP to iterate the results and then re-SQL, this is not seen how to implement in a SQL, but there should be a great God can do it, I am not clear.
------Solution--------------------
In the following sentence, I test in Oracle is possible:
SELECT * from the users u where u.name like '% ' | | (select name from Users where id=1) | | ' %';
------Solution--------------------
LS, if only one piece of data can be fetched in the subquery, then the LZ problem is not a problem.
The crux of the problem is that he matches a result set in the like. I just checked, and the function in MySQL didn't match a string of characters.
, LZ you give up, it is best to change the wording, because even if the implementation of SQL statements, efficiency will be surprisingly under.
------Solution--------------------
discuss
SQL Code
Select si.user_id from Ecs_store_info as Si WHERE si.store_name like (SELECT wl.store_name from Ecs_wpaqq_log as WL where Wl.lngshopid=0)
is how to use the SELECT statement after the like key