Home > database > A SQL statement, test for a long time
A SQL statement, test for a long time
Time:10-10
The table has a field in a Table b field b All field data is letter
Now I want to find out in the table a field a meet: in b all records with a beginning and end with a
I like to write, record the lookup is not complete, there are omissions, don't know what is going onSELECT a. * FROM a, b WHERE a.a LIKE CONCAT (b.b, "%") AND a.a LIKE CONCAT (" % ", b.b)
In the effect of the kind of writing is still the same, there is a miss, can't the SELECT a. * FROM a JOIN b ON a.a LIKE CONCAT (" ", b.b, "%") AND a.a LIKE CONCAT (" % ", b.b, "")
Beg your answer, thank you
CodePudding user response:
Should not be to like a good understanding with b.b ?SELECT * FROM test_a a, test_b b WHERE b.k ey LIKE CONCAT (a.k ey, '%', a.k ey)