|
So, how would I join the two records by rownumber? I think I have to<iseries@xxxxxxxxxxxx> wrote:
use a subquery since I'll need to alias the rownumber results but I
can't quite get my head around the syntax
The update would look like:
update realtable set firstname = firstfake, lastname = lastfake
the where would use the derived rownumber columns (say rn1,and rn2)
But how to build the suquery so that the records selected could be
used for an update is where I get stuck. I tried this:
update realtable set firstreal = firstfake, lastreal = lastfake where
rownumber over(order by firstreal,lastreal) =
( select
rownumber() over(order by firstfake,lastfake)
from fakeemp)
But that didn't work. I need to join on the derived rownumbers.
Can't quite sort that out.
Pete
Charles Wilt wrote:
ROWNUMBER()
Charles
On Fri, Jan 29, 2010 at 10:05 PM, Dennis Lovelady
Probably have to reorg the "live" member so that the rrns wereHmmm... hadn't considered that. Probably; I don't know a way to get
sequential and in the same range, yes? (the file is quite old and
hasn't been re-orged ever to my knowledge)
--rownumber (as opposed to RRN) from DB2.
Good luck with it; while I haven't done it myself (other than to
test the sample before I sent) it looks workable.
Dennis Lovelady
http://www.linkedin.com/in/dennislovelady
--
Hard work pays off in the future. Laziness pays off now.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L)
mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To
subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please
take a moment to review the archives at
http://archive.midrange.com/midrange-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.