Algumas idéias podem brotar a partir:

[EMAIL PROTECTED]> create table t ( p int, e int, mx int, mn int, pp int );

Table created.

[EMAIL PROTECTED]> alter table t add primary key ( p, e );

Table altered.

[EMAIL PROTECTED]>
[EMAIL PROTECTED]> insert into t values ( 3948, 01, 3, 1, 1 );

1 row created.

[EMAIL PROTECTED]> insert into t values ( 3948, 02, null, null, null );

1 row created.

[EMAIL PROTECTED]> insert into t values ( 3948, 03, null, null, null );

1 row created.

[EMAIL PROTECTED]> insert into t values ( 3949, 01, 30, 10, 10 );

1 row created.

[EMAIL PROTECTED]> insert into t values ( 3949, 02, null, null, null );

1 row created.

[EMAIL PROTECTED]>
[EMAIL PROTECTED]> select p, e, first_value(mx) over (partition by p order
by p) fv_mx,
  2               first_value(mn) over (partition by p order by p) fv_mn,
  3               first_value(pp) over (partition by p order by p) fv_pp
  4    from t
  5  /

            P             E         FV_MX         FV_MN         FV_PP
------------- ------------- ------------- ------------- -------------
         3948             1             3             1             1
         3948             2             3             1             1
         3948             3             3             1             1
         3949             1            30            10            10
         3949             2            30            10            10

5 rows selected.

[EMAIL PROTECTED]>
[EMAIL PROTECTED]> update t
  2     set ( mx, mn, pp ) = ( select first_value(mx) over (partition by p
order by p),
  3                                   first_value(mn) over (partition by p
order by p),
  4                                   first_value(pp) over (partition by p
order by p)
  5                              from t t2
  6                             where t.p = t2.p and rownum = 1)
  7  /

5 rows updated.

[EMAIL PROTECTED]>
[EMAIL PROTECTED]> select * from t;

            P             E            MX            MN            PP
------------- ------------- ------------- ------------- -------------
         3948             1             3             1             1
         3948             2             3             1             1
         3948             3             3             1             1
         3949             1            30            10            10
         3949             2            30            10            10

5 rows selected.


On 11/28/06, cegoncalvesvr <[EMAIL PROTECTED]> wrote:
>
>   Amigos,
>
> Preciso copiar o conteúdo das colunas (Est.max, Est.Min e Pont.Ped)
> para outro estoque 02, cujas as mesmas colunas, estão vazias.
> Veja a situação abaixo:
>
>
> Produto Estoque Est.Max Est.Min Pont.Ped
> 3948 01 3 1 1
> 3948 02
>
> Preciso replicar o conteudo das colunas para as mesmas
> colunas, só que para o estoque da linha 02.
>
> Abs.
> Eduardo
>
>  
>



-- 
Marcio Portes
Material Tecnico em Portugues - http://mportes.blogspot.com
Practical Learning Oracle     -
http://mportes.blogspot.com/2006/02/practical-learning-oracle.html


[As partes desta mensagem que não continham texto foram removidas]

Responder a