SQL中如何用一个表更新另一个表
for ACCESS :
update a, b set a.name=b.name1 where a.id=b.id
for SQL Server:
"update a set a.name=b.name1 from a,b where a.id=b.id"
update a set a.status=b.status
from table1 a,table2 b
where a.id1=b.id1
update a inner join b on a.a1=b.b1 set a.a2=b.b2条件
update table1 set a.status = b.status
from table1 a inner join table2 b
on a.idl = b.idl
http://topic.csdn.net/t/20041013/14/3451961.html
http://www.cnblogs.com/hanguoji/archive/2007/02/01/636723.aspx
相关文档:
*
sql xml 入门:
--by jinjazz
--http://blog.csdn.net/jinjazz
1、xml: 能认识元素、属性和值
2、xpath: 寻址语言,类似wind ......
1.按姓氏笔画排序:
Select * from TableName Order By CustomerName Collate Chinese_PRC_Stroke_ci_as
2.数据库加密:
select encrypt('原始密码')
select pwdencrypt('原始密码')
select pwdcompare('原始密码','加密后密码') = 1--相同;否则不相同 encrypt('原始密码')
select pwdencrypt('原始密码')
select pw ......
1、查询表中重复数据。select * from people
where peopleId in (select peopleId from people group by peopleId having count(peopleId) > 1)
2、删除表中多余的重复记录,重复记录是根据� ......
1、 用程序中,保证在实现功能的基础上,尽量减少对数据库的访问次数;通过搜索参数,尽量减少对表的访问行数,最小化结果集,从而减轻网络负担;能够分开的操作尽量分开处理,提高每次的响应速度;在数据窗口使用SQL时,尽量把使用的索引放在选择的首列;算法的结构尽量简单;在查询时,不要过多地使用 ......