🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.database
Article #289

Re.: Replace query in relational dbms

#289
From: Mohan Palat
Date: Mon, 29 Sep 1986 23:07
27 lines
1488 bytes
> From: vacca@burdvax.UUCP (Dave Vacca)
> 
> replace t1 ( value = t2.total ) where t1.UKEY = t2.KEY
> 
> The join is one-to-many (t1-to-t2).  Thus, there may be 3 rows in t2
> which have the same key value as just 1 row in t1.  There will never
> be 2 or more rows in t1 which have the same key value as 1 row in t2.
> 
> Do I have to normalize t2?


	It is not clear as to what exactly you want this query to do -
	if, for example, there are 3 tuples in t2 that satisfy your
	qualification, which one of these three do you want to be 
	selected in the replace operation? In other words, the variable
	"value" could take on 3 possible values corresponding 
	to the "total" column of each of the 3 selected tuples and it
	is not clear as to which of these 3 values you want the variable
	"value" to contain. 
	One way to make the selection more restrictive might be to add another 
	qualifier to the query:
		replace() where t1.UKEY=t2.KEY and ...

	Mohan Palat
	AT&T Network Systems
	Lisle, IL
Technical Details
Message-ID: <3011@ihuxf.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!cbatt!ihnp4!ihuxf!mohan

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!cbatt!ihnp4!ihuxf!mohan
From: mohan@ihuxf.UUCP (Mohan Palat)
Newsgroups: net.database
Subject: Re.: Replace query in relational dbms
Message-ID: <3011@ihuxf.UUCP>
Date: Mon, 29-Sep-86 19:07:36 EDT
Article-I.D.: ihuxf.3011
Posted: Mon Sep 29 19:07:36 1986
Date-Received: Tue, 30-Sep-86 21:22:32 EDT
Distribution: net
Organization: AT&T Bell Labs, Naperville, IL
Lines: 27