Search a whole table in mySQL for a string

后端 未结 8 1590
孤城傲影
孤城傲影 2020-12-14 01:13

I\'m trying to search a whole table in mySQL for a string.

I want to search all fields and all entrees of a table, returning each full entry that contains the speci

8条回答
  •  囚心锁ツ
    2020-12-14 02:03

    for specific requirement the following will work for search:

    select * from table_name where (column_name1='%var1%' or column_name2='var2' or column_name='%var3%') and column_name='var';
    

    if you want to query for searching data from the database this will work perfectly.

提交回复
热议问题