我有一张桌子:
-------------------
col1 |col2 |
--------------------
DaveSmith |Dave |
RogerChu |Roger |
GaryBee |Dan |
如果它包含col2 ....
的内容,我想选择col1DaveSmith
RogerChu
我不太清楚如何解决这个问题:
SELECT col1 WHERE col1 REGEXP (SELECT something?? )????
SELECT col1 WHERE col1 LOCATE (SELECT something?? , SELECT somethingelse?? )??
感谢
答案 0 :(得分:2)
试试这个:
SELECT col1 WHERE col1 REGEXP (COL2)