我正在进行更新,但价值有'和"报价, 我该怎么办?
这是我的查询的样子
Update Users
set info = '[user{"LinkAction('togglemore', 'companies','jobs')","IsVisible":true}]'
where user like '%admin%'
如何让SET考虑'中的所有内容。单引号'
答案 0 :(得分:2)
您可以使用两个单引号''
Update Users
set info = '[user{"LinkAction(''togglemore'', ''companies'',''jobs'')","IsVisible":true}]'
where user like '%admin%'
sqlfiddle:http://sqlfiddle.com/#!18/402e8/1
答案 1 :(得分:0)
这对我有用:
func previewingContext(_ previewingContext: UIViewControllerPreviewing, viewControllerForLocation location: CGPoint) -> UIViewController?
{
guard let indexPath = self.detailedTableView.indexPathForRow(at: location),
let cell = self.detailedTableView.cellForRow(at: indexPath) else { return nil }
}
输出:
update t1
set name1 = "[user{\"LinkAction('togglemore', 'companies','jobs')\",\"IsVisible\":true}]"
where id1=1;
select name1 from t1 where id1=1