Sql query with special characters - how to handle?

前端 未结 5 1001
南方客
南方客 2021-01-06 16:53

I\'ve few emp names like

  1. john,1
  2. devil\'s
  3. corn

something like this

Now when

5条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-06 17:38

    select * from emp where empname like ('john\,1','devil\'s','corn\'') escape '\'
    

    use keyword escape to mention escape character for the query.

提交回复
热议问题