What's the difference between “LIKE” and “=” in SQL?

前端 未结 13 922
悲哀的现实
悲哀的现实 2020-12-05 12:56

Is there any difference between:

SELECT * FROM users WHERE username=\"davyjones\"

and

SELECT * FROM users WHERE username LI         


        
13条回答
  •  一个人的身影
    2020-12-05 13:22

    That will give you the same result. However, LIKE allows wildcards, for example...

    SELECT * FROM users WHERE username LIKE 'davy%'
    

    The only syntax problem was double quotes instead of single quotes

提交回复
热议问题