create table siebel.liu_pricelist2 asSELECT customerid,customername,pricelistnameFROM siebel.liu_pricelist group by customerid,customername,pricelistname Read More
posted @ 2012-12-13 23:31 刘礼 Views(133) Comments(0) Diggs(0)
一条Update更新语句是不能更新多张表的,除非使用触发器隐含更新。而表的更新操作中,在很多情况下需要在表达式中引用要更新的表以外的数据。我们先来讨论根据其他表数据更新你要更新的表一、MS SQL Server 多表关联更新 sql server提供了update的from 子句,可以将要更新的表与其它的数据源连接起来。虽然只能对一个表进行更新,但是通过将要更新的表与其它的数据源连接起来,就可以在update的表达式 中引用要更新的表以外的其它数据。 一般形式:update A SET 字段1=B表字段表达式, 字段2=B表字段表达式 from B WHERE 逻辑表达式例如: UPDATE. Read More
posted @ 2012-12-13 23:30 刘礼 Views(424) Comments(0) Diggs(0)