update question
- From: YALTA <gchenault@xxxxxxxxx>
- Date: Sun, 08 Jul 2007 23:31:40 -0000
Hello,
I am new to working with SQL and I have a few questions. One the
update query below, one will it work and I looking for a better
understanding of the steps that are taking when this query runs. This
is in Interactive sql. Only a certain number of records need to be
update in the address table based off a particular address in the
tblee.
tbladdress
id int
street address varchar
phone varchar
fax varchar
tblmain
id int
lastname varchar
firstname varchar
tblee
id int
sales_address varchar
begin tran
update tbladdress
set phone = 'xxxxxxxxx',fax = 'yyyyyyyyyy'
from tbladdress y inner join
(
select phone, fax from tblmain m
join tblee a on m.id = a.id
where phone is null and fax is null
)b join b.id = y.id
where y.phone is null and y.fax is null
commit tran
I would think and correct me if I am wrong that these type queries
first pull the data from the selected statement and then will update
the join on the records returned?
Any help would be great
.
- Follow-Ups:
- Re: update question
- From: Rob Verschoor
- Re: update question
- Prev by Date: begin tran issues
- Next by Date: Re: ASE 15.0.2 A suitable JVM could not be found
- Previous by thread: begin tran issues
- Next by thread: Re: update question
- Index(es):
Relevant Pages
|
|