There are two tables, table A and table B,
A table, A field called: ID,
B table, there is a field called: current_address,
Now want to be a "like the subquery", namely,
Select * from b where current_address like '% table Anderson D %'
CodePudding user response:
But how to write is correct, there is a great god to ask for adviceCodePudding user response:
Select a. *, * from a to b. a, b, b where biggest urrent_address like concat (' % ', Anderson D, '%');CodePudding user response:
Two table joins, the condition is to write b table current_address like '% table Anderson D %' with respect to okCodePudding user response:
The select biggest urrent_address from A tableInner join table B on biggest urrent_address like concat (' % ', A table. Id, '%');
CodePudding user response:
Select distinct (biggest urrent_address) from table BInner join A table on biggest urrent_address like concat (' % ', A table. Id, '%');
CodePudding user response:
Select * from a, b b. where biggest urrent_address=concat ('/artices/', Anderson, d)CodePudding user response:
Select * from b where current_address like concat ('/artices/', 'table Anderson D %')
Union all select * from b where current_address like concat (other path/'/', 'table Anderson D %')
Union all select * from b where current_address like concat (other path 2/'/', 'table Anderson D %')
,,,
Delete the like the sign on the left, so that we can use index