By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
| cText | cText2 |
|---|---|
| Hello-World | Test |
| HelloWorld | Test- |
| CONCAT('SELECT * FROM test1 WHERE ',GROUP_CONCAT(C.COLUMN_NAME SEPARATOR ' LIKE ''%-%'' OR '), ' LIKE ''%-%''') |
|---|
| SELECT * FROM test1 WHERE cText LIKE '%-%' OR cText2 LIKE '%-%' |