How can I modify this SQL statement? SQLcodeSELECTsi. user_idFROMecs_store_infoASsiWHEREsi.store_namelike (SELECTwl. mechanism) is how to use the SQL statement selec after like is critical. how can I modify it?
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 --------------------
I understand the concept of LZ, but like is a fuzzy match of a string of characters. If you want to fuzzy match any one of the many characters in LZ, you can only use in or use PHP to traverse the results and then re-run the SQL statement. I have never seen how to implement it in one SQL statement, but I don't know how to do it.
------ Solution --------------------
Using the following sentence, I can test it in Oracle:
Select * from users u where u. name like '%' | (select name from users where id = 1) | '% ';
------ Solution --------------------
LS. if only one unique data record can be retrieved from the subquery, the LZ problem is not a problem.
The key to the problem is that the LIKE matches a result set... I just checked that mysql functions cannot fuzzy match a string of characters.
You should give up on LZ. you 'd better change the writing method, because even if you use SQL statements, the efficiency will be surprisingly low.
------ Solution --------------------
Discussion
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