可能重复:
MySQL LIKE IN()?
我有 2 张桌子
atm_name_initials(初始)
KS
FW
GE
SD
atm_tasks_dit (task_name,task_given_to)
task1 KS
task2 GE
task3 GE/SD
现在我想建立所有与他们SELECT
不同的名字atm_name_initials
WHERE
IN LIKE atm_tasks_dit.task_given_to
这是我到目前为止所拥有的:
SELECT initial FROM atm_name_initials
WHERE initial
IN
(
SELECT DISTINCT task_given_to FROM atm_tasks_dit
WHERE on_big_project_id = 29
)
atm_name_initials.initial
如果确切地建立了值,那么这段代码会搜索什么atm_tasks_dit.task_given_to
我想要类似的东西
SELECT initial FROM atm_name_initials
WHERE initial
"IS LIKE" IN
'%
(
SELECT DISTINCT task_given_to FROM atm_tasks_dit
WHERE on_big_project_id = 29
)
%'
或者其他的东西...
任何帮助将不胜感激,谢谢!