 |
|
 |
|  | 包括查询条件字段的更新 | back to 数据库技术 forum | |  | 作者:yggzs2002,6级 | 分数:0 | 日期:2011/2/19 11:01:00 | 类别:数据库技术, 技术问题 | 回复:9次 | 浏览:2565次 | 状态:无分贴 |
|
|
| M老师,org表是这样的结构:
总共8列,分别是
id int identity (仅此字段不允许为空)
no1 tinyint
no2 tinyint
......
no7 tinyint
现在某条记录八个字段都要更新,包括id字段
id no1 no2 no3 no4 no5 no6 no7
......
2010131 7 6 5 8 8 8 8
......
更新为:
2010132 7 6 5 8 3 3 8
我用的SQL语句是这样:
updata org
set id=2010132,no1=7,no2=6,no3=5,no4=8,no5=3,no6=3,no7=8
where id=2010131
你看有问题吗?(七星彩号码) |
 | [F0143978]  |
| |
|
|
| | re [8] 包括查询条件字段的更新 | 数据库技术 forum | | - yggzs2002 | 11-02-21 09:45 | |
| 哦,
1.用ADO的时候select 语句的返回值都要放在数据读取器里面,或者记录集里面;
2.SQL语句里面 select 语句可以直接返回值,像你上次说的:
insert into no1
select (select a from origina b where b.id=t.id+1)-a
from origina t
括号里面的 select a from origina b where b.id=t.id+1 语句就直接返回一个值作为被减数了。
M老师,这种理解方法对吗?
|
 | [F0143986]  |
| |
|
|
|
|
 |