Using Rownum
From: Rune Bjerke <runbjerk_at_online.no>
Date: 21 Jan 2002 14:30:04 -0800
Message-ID: <ad2d9a7.0201211430.3ee970a4_at_posting.google.com>
Date: 21 Jan 2002 14:30:04 -0800
Message-ID: <ad2d9a7.0201211430.3ee970a4_at_posting.google.com>
I have read a lot about rownum and can't find a good solution to
update a table. The problem is this:
table a
ex: id1,fact1
table b
What I thought was to use rownum, but found out that you can't use
rownum=2 etc.
After some testing I tried to use a update statement like this
update b set fact1 =
ID
fact
id2,fact1
id2,fact2
id3,fact1
id3,fact2
id3,fact3
etc.
ID
fact1
fact2
fact3
(select fact from (select rownum rnum,fact from a where a.id=b.id)
where rnum=2)
then I get wrong column.
How could I solve this?
Regards
Rune
Received on Mon Jan 21 2002 - 23:30:04 CET