一段mysql更新update代码 求高手!!求指教!!紧急!
String sql = "update books set bookName='" + bookName + "',ISBN='"
+ ISBN + "',publisher='" + publisher + "',author='" + author
+ "' where id="+id;
--------------------------------------------------------------------------------------------------------------
以上代码 出去id外 其他全是字符string类型的字段 如果id没出现在where句中 而出现在set~到where之间的句子当中 那么这个句子该如何写?? 求高人!!
+ ISBN + "',publisher='" + publisher + "',author='" + author
+ "' where id="+id;
--------------------------------------------------------------------------------------------------------------
以上代码 出去id外 其他全是字符string类型的字段 如果id没出现在where句中 而出现在set~到where之间的句子当中 那么这个句子该如何写?? 求高人!!
作者: meislql3 发布时间: 2011-06-12
楼主和那个qiyueqinglian搞同样的事情?
http://topic.csdn.net/u/20110610/17/fa7cf824-b181-4623-93d1-6ef6c7d4b80f.html
sql = "update books set id="+oldid+" bookName=..... where id="+newid;
http://topic.csdn.net/u/20110610/17/fa7cf824-b181-4623-93d1-6ef6c7d4b80f.html
sql = "update books set id="+oldid+" bookName=..... where id="+newid;
作者: trocp 发布时间: 2011-06-12
sql = "update books set id="+oldid+", bookName=..... where id="+newid;
作者: trocp 发布时间: 2011-06-12
谢谢楼上 你理解错啦
我是说要是换个其他的int型的 如何在set后边添加??、
我是说要是换个其他的int型的 如何在set后边添加??、
作者: meislql3 发布时间: 2011-06-12