请问
sql语句中,update语句,怎样把一张表中的字段名为'A_'或'A-'开头的所有字段都更新成'1'
update table set item=item.replac('A_',''),item=item.replac('A-','')
update table set item=item.replac('A_','1'),item=item.replac('A-','1')
SQL code:
update t set A_0=1,A_1=1,a_2=1
不是把字段名更新成1,而是把以A_或A-开头的字段对应的值改成1
哥,列数不固定阿...
SQL code:
update 表 set 字段='1' where charindex('A_',字段)>0 or charindex('A-',字段)>0
charindex标识符无效,我用的oracle