How to Check if value exists in a MySQL database

后端 未结 6 698
眼角桃花
眼角桃花 2020-12-12 17:15

Suppose I have this table:

id | name | city
------------------
1  | n1   | c1
2  | n2   | c2
3  | n3   | c3
4  | n4   | c4

I want to check

6条回答
  •  既然无缘
    2020-12-12 18:07

    For Matching the ID:

    Select * from table_name where 1=1
    

    For Matching the Pattern:

    Select * from table_name column_name Like '%string%'
    

提交回复
热议问题