Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Database > SQL Language
|
SQL Language SQL Language discussions not specific to a particular RDBMS program or vendor.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Language section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 5th, 2004, 01:13 AM
Authorized User
 
Join Date: Dec 2004
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default Outer Join, 2 columns

Do I understand correctly that outer joins are used when only one column uniquely identifies rows? I have seen other posts on this forum and others on outer joins, but those posts address a situation where only one column uniquely identifies each row.

I need to copy all rows from tblA that are not in tblB, into tblB.
TblA and TblB have same structure.
Rows are made unique by two columns: DateTime, ID


thanks,
jking
__________________
Thanks,
J K
 
Old December 5th, 2004, 04:14 AM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 625
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to jemacc
Default

try something like this

Code:
UPDATE TblA 
SET TblA.Col1 =tblB.col1
WHERE NOT EXISTS (select ID from tblB WHERE TblB.id = TblA.id and tbla.datetime=tblb.datetime)

Jaime E. Maccou
Applications Analyst
Database Programmer





Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't figure out an OUTER JOIN statement dhsmd SQL Language 5 September 18th, 2008 01:02 AM
Non-ANSI outer join operators Jeff Kanning SQL Server 2005 14 September 9th, 2008 08:02 PM
left outer join keyvanjan Classic ASP Basics 1 April 15th, 2006 05:37 AM
left outer join keyvanjan Classic ASP Professional 0 February 5th, 2006 11:54 AM
outer join on same table roog SQL Language 4 September 30th, 2004 05:31 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.