在线急等一个问题
SqlCommand mycom = new SqlCommand("update shipment_header set carrier='a' where internal_shipment_num=(select internal_shipment_num from shipping_container where container_id='" + TextBox1.Text.ToString() + "'", con);这样的语法可对呀??
我是指里面的SQL语句 --------------------编程问答--------------------
SqlCommand mycom = new SqlCommand("update shipment_header set carrier='a' where internal_shipment_num in (select internal_shipment_num from shipping_container where container_id='" + TextBox1.Text.ToString() + "'", con);--------------------编程问答-------------------- 肯定不对,要是对的话,你就不用上来问了 --------------------编程问答-------------------- internal_shipment_num=
change to
--------------------编程问答-------------------- SqlCommand mycom = new SqlCommand("update shipment_header set carrier='a' where internal_shipment_num=(select internal_shipment_num from shipping_container where container_id='" + TextBox1.Text.ToString() + "')", con);
internal_shipment_num in
少个)吧 --------------------编程问答-------------------- = 改成 in --------------------编程问答-------------------- select internal_shipment_num 子查询可能会返回多个值的,所以要用in
--------------------编程问答-------------------- 语法上我没看出来你出在哪里。。。
但是你的SQL语句跟1楼的就是判断条件不一样而已。
--------------------编程问答-------------------- 少个) --------------------编程问答-------------------- SqlCommand mycom = new SqlCommand("update shipment_header set carrier='a' where internal_shipment_num in (select internal_shipment_num from shipping_container where container_id='" + TextBox1.Text.ToString() + "')", con);
或使用exists
补充:.NET技术 , C#