Ordination in CONECT BY PRIOR

Dúvidas, dicas e truques de PL/SQL. Aqui também vão assuntos relacionados a pacotes, triggers, funções, Java-Stored Procedures, etc
  

Poston Tue, 11 Apr 2006 2:01 pm

Personally, I haven't been able to solve a problem of sorting that I'm having, the select that I am running is as follows:
Code: Select all
SELECT LPAD(cd_material, LENGTH(cd_material) + ((LEVEL - ) * 4), ' ') cd_material
,rownum
FROM qs_w_estrutura_material
WHERE LEVEL > 1
AND LEVEL <= NVL((null + 1), LEVEL)
START WITH cd_mat_estrut_pai IS NULL
AND nr_solicitacao = 100362
AND id_estrutura = 1
CONNECT BY PRIOR cd_mat_estrut = cd_mat_estrut_pai
AND nr_solicitacao = 100362
AND id_estrutura = 1
order by rownum
the result is not exactly what I was hoping for some records not ordering correctly.

Follows part of the result, which shows that the record on this album 00003/0000 incorrect, this should be just below the record/0000 00002
Code: Select all
4000/12800                  95
        4000/02800              96
            0000/00002          97
            0000/00204          98
            0000/00206          99
            0001/00215         100
            0002/00115         101
            0002/00117         102
            0002/00126         103
            0002/00203         104
            0002/00214         105
            0002/00233         106
            0003/00140         107
            0003/00225         108
            0004/00005         109
            0005/00015         110
            0006/00102         111
            0009/00147         112
            0011/00291         113
            0011/00292         114
            0012/00009         115
            1012/00011         116
            1014/00036         117
            1015/00010         118
            0000/00003         119
    4055/10253                 120
        4055/00253             121
            1025/00905         122
    4056/00089                 123
        4056/00089K            124
            1025/00965         125
if anyone can help I appreciate.
aoliveira
Location: Blumenau-SC

[ Alex ]

Poston Tue, 11 Apr 2006 2:41 pm

Does not this order by the problem?
Code: Select all
order by rownum
have tried to sort by a field?
dr_gori
Location: Portland, OR USA

Thomas F. G

Você já respondeu a dúvida de alguém hoje?
http://glufke.net/oracle/search.php?search_id=unanswered



Return to PL/SQL

Who is online

Users browsing this forum: No registered users and 15 guests