Home » SQL & PL/SQL » SQL & PL/SQL » Relation between two gold
Relation between two gold [message #671298] Tue, 21 August 2018 05:27 Go to next message
purnima1
Messages: 76
Registered: June 2014
Member
hi all,

I have one table with following data .
Now We have two columns in this table gold_id(G1) ,rel_gold_id (G2)

I want a new column namely "gold_relation" which will define hierarchical relation between above mentioned columns

for eg: g1 > g2
g1 >g2 >g3
g1 > g4
g1 >g2

and so on ......

At some places I have observed there is duplicate relation . Do I need to remove those remove this duplicate data before defining relation.
Also in this scenario luckily all the rows have same gold_id(G1) but this is not always a case.

could you please help how I can start creating relations


CREATE TABLE MANUAL_REVIEW_ENT
(
  RNK                NUMBER,
  MATCH_GROUP_ID     NUMBER,
  PRIORITYSCORE      NUMBER,
  SOURCE_SYS_ID      VARCHAR2(20 CHAR),
  GOLD_ID            NUMBER,
  SOURCE_SYS_CD      VARCHAR2(20 CHAR),
  REL_SOURCE_SYS_ID  VARCHAR2(20 CHAR),
  REL_GOLD_ID        NUMBER,
  REL_SOURCE_SYS_CD  VARCHAR2(20 CHAR)
);

Insert statements here
Re: Relation between two gold [message #671299 is a reply to message #671298] Tue, 21 August 2018 05:29 Go to previous messageGo to next message
purnima1
Messages: 76
Registered: June 2014
Member
Unable to upload all rows . There is limit issue I think
Re: Relation between two gold [message #671303 is a reply to message #671299] Tue, 21 August 2018 06:39 Go to previous messageGo to next message
EdStevens
Messages: 1082
Registered: September 2013
Senior Member
purnima1 wrote on Tue, 21 August 2018 05:29
Unable to upload all rows . There is limit issue I think
Why do you think you need to upload them all? Can't you create a small set of data to demonstrate/test the issue?
Re: Relation between two gold [message #671307 is a reply to message #671299] Tue, 21 August 2018 07:15 Go to previous message
Michel Cadot
Messages: 66475
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

You also have to post, FORMATTED AND COLUMNS ALIGNED, the result you want for the data you give, EXPLAINING WITH WORDS.

http://www.orafaq.com/forum/mv/msg/204980/671306/#msg_671306

[Updated on: Tue, 21 August 2018 07:16]

Report message to a moderator

Previous Topic: Joining multiple rows and creating multiple columns
Next Topic: Running settlement of inward vs outward quantity
Goto Forum:
  


Current Time: Sun Jul 21 16:21:23 CDT 2019