MySQL connection query uses?

I have been trying to make it work for a long time, but it doesn’t seem to work, maybe it’s not even possible, what I want to do is use a MySQL connection query like this I found Examples…

SELECT *
FROM Table1
INNER JOIN Table2 ON Table1.col LIKE'%' + Table2.col + ' %'

But it doesn’t seem to work at all, any help that can be given would be great, thank you!

try

SELECT * 
FROM Table1
INNER JOIN Table2 ON Table1.col LIKE CONCAT('%', Table2.col,'%')

MySQL string connection is different from other databases, so If you want to port your application, you need to have an alternate version where || is used as the concatenation operator, as mentioned by Michael in another answer. This operator does not work in MySQL because It means or.

I have been trying to make it work for a long time, but it doesn’t seem to work, maybe it’s not even possible, what I want to do is use The example I found for executing MySQL connection query like this…

SELECT *
FROM Table1
INNER JOIN Table2 ON Table1.col LIKE '%' + Table2.col +'%'

But it doesn’t seem to work at all, any help that can be given would be great, thank you!

Try

SELECT *
FROM Table1
INNER JOIN Table2 ON Table1.col LIKE CONCAT('%', Table2.col,'%')

MySQL’s string connection is different from other databases, so if you want to port your application, you need There is an alternate version where || is used as a concatenation operator, as mentioned by Michael in another answer. This operator does not work in MySQL because it means or.

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 2982 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.