sim*_*one 5 sql sql-server sql-like
如何使用like来自两个不同表的运算符执行 SQL 查询?
我需要类似的东西:
select * from table1 where name like %table2.name
Run Code Online (Sandbox Code Playgroud)
它不是一个公共字段,而是另一个表上一个字段的子字符串。
不太确定精确的语法,但这里有一个想法:
select ... from (
select ID, Foo as F from FooTable
union all
select ID, Bar as F from BarTable) R
where R.F like '%text%'
Run Code Online (Sandbox Code Playgroud)