Advertisement

06.16.2007 at 02:24PM PDT, ID: 22638687
[x]
Attachment Details

SQL update with join

Asked by dcass in SQL Query Syntax, MS SQL Server

Tags: update, sql, join

I need a simple sql that will update a missing date field from the single record (per call id) Call Header to the multiple record (per call id) Call Detail table.  
I've been trying:
UPDATE    calldtl left outer JOIN
                      callhdr ON calldtl.callid = callhdr.callid
SET              calldt.dtstamp = callhdr.dtstamp
WHERE     (DTStamp IS NULL)

but it won't take anything after the update calldtl - I tried inner and left outer and outer.
Start Free Trial
[+][-]06.16.2007 at 02:28PM PDT, ID: 19299593

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: SQL Query Syntax, MS SQL Server
Tags: update, sql, join
Sign Up Now!
Solution Provided By: angelIII
Participating Experts: 2
Solution Grade: A
 
 
[+][-]06.16.2007 at 03:21PM PDT, ID: 19299674

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32