易截截图软件、单文件、免安装、纯绿色、仅160KB

SQL in批量添加

SQL code:

@id nvarchar(500)

insert into dance (a,b,c) value(0,0,0) Where id in (@id) and n=417


@id=1,2,3,4,5
我想把@id=1 =2 =3 =4 =5的这5条记录 and n=417 的a b c字段全部更新为0 请问各位大哥这样的语句怎么写?



SQL code:
update dance set a=0,b=0,c=0 where id in(1,2,3,4,5) and n=417


SQL code:

update
dance
set
a=0,b=0,c=0
where
charindex(','+ltrim(id)+',',','+@wher+',')>0 and n=417


SQL code:
insert into dance (a,b,c) value(0,0,0) Where charindex(','+ltrim(id)+',',','+@id +',')>0 and n=417


OR:

update dance set a=0,b=0,c=0 where charindex(','+ltrim(id)+',',','+@id+',')>0 and n=417
想要哪个

楼上的两位,抱歉我写错了,修改下:

·id=1,2,3,4,5
我想把@id=1 =2 =3 =4 =5的这5条记录 and n=417 的a b c字段全部添加到另一张表中,其中a,b,c要等于0, 请问各位大哥这样的语句怎么写?

SQL code:
insert into


相关问答:

jsp链接sql2000的疑问?



type Exception report


message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jas ......

Asp+sql server问题 - Web 开发 / ASP

我一个项目,有个插入操作,具体是这样的:
我有进货信息表。在出货时选择相应的进货信息,输入数量,选择部门后,点保存按钮,由于网络延时,点一下没有反映,于是用户就又点一下,导致一次插入了两条记录:
例: ......

如何使用MySQL - MS-SQL Server / 基础类

刚刚接触MySQL,不知道该如何去查看数据,插入数据,创建数据库、表,用哪为前辈能指教一二?

MySQL 5.1参考手册

引用
兄弟你会结贴吗?
mysql 参考手册

baidu

MySQL官方文档 http://dev.mysql.com/doc ......

两句SQL并一句,有问题. - MS-SQL Server / 基础类

第一句:
select ht.gfdm,gfdm.gfmc,gfdm.lb ,sum(jh.htdj*jh.htsl)as je
from ht left join gfdm on ht.gfdm=gfdm.gfdm 
 join jh on ht.htbh=jh.hth 
and ht.htbh not like'del%' and ht. ......

执行sql - PowerBuilder / 数据库相关

update test set qty = qty - 1 where (location,sku,valid_date) 
in (select location,sku,min(valid_date) from test
where location = 'chuwei' and item_code = '5678' group by location,sku)
以上语 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号