Help me create a hierarchical query.
I have two table:
Table 1(dic_kgs)
KGS_ID KGS_PARENT_ID KGS_CODE
1 A
2 1 A0
3 1 A1
4 B
and so on
Table 2(dic_kgs_strings)
KGS_ID LANG_ID KGS_NAME KGS_ADD_INFO
1 1 Name1
2 1 Name2
3 1 Name3
4 1 Name4
and so on.
I want to get result in the follow view:
A Name1
A0 Name2
A1 Name3
B Name4
I have writen only part of query:
select kgs_code
from dic_kgs
start with dic_kgs.kgs_parent_id is null
connect by prior dic_kgs.kgs_id = dic_kgs.kgs_parent_id;
Thanks.