Search a whole table in mySQL for a string

后端 未结 8 1593
孤城傲影
孤城傲影 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 01:59

    If you're using Sublime, you can easily generate hundreds or thousands of lines using Text Pastry in conjunction with multiple line selection and Emmet.

    So in my case I set the document type to html, then typed div*249, hit tab and Emmet creates 249 empty divs. Then using multiple selection I typed col_id_ in each one and triggered Text Pastry to insert an incremental id number. Then with multiple selection again you can delete the div markup and replace it with the MySQL syntax.

    0 讨论(0)
  • 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.

    0 讨论(0)
提交回复
热议问题