Skip to main content
removeu 123 caracteres do conteúdo
Fonte Link
Kleudy Silva
  • 101
  • 1
  • 1
  • 4

Isso deve resolver seu caso:

select lin.*
from ( SELECT * FROM (SELECT DISTINCT o.STORAGE_TYPE, COUNT(o.QUANTIDADE) as 
                             qtd_materiais, rownum as linha   
                      FROM mopsao.vw_monitoramento_do@MOPSAO m INNER JOIN V 
                      IEW_ORDENS_A_COLETAR o 
                      ON 
                      m.DELIVERY = o.DELIVERY AND m.cod_mat_c = o.MATERIAL WHERE 
                      m.status_andamento = 'Pickado' 
                      GROUP BY o.STORAGE_TYPE ORDER BY qtd_materiais DESC) lin
where lin.linha <= 8

fazer o mesmo script pegando as linhas > 8 SELECT lin.* FROM (SELECT DISTINCT o.STORAGE_TYPE, COUNT(o.QUANTIDADE) as qtd_materiais, rownum as linha
FROM mopsao.vw_monitoramento_do@MOPSAO m INNER JOIN V IEW_ORDENS_A_COLETAR o ON m.DELIVERY = o.DELIVERY AND m.cod_mat_c = o.MATERIAL WHERE m.status_andamento = 'Pickado' GROUP BY o.STORAGE_TYPE ORDER BY qtd_materiais DESC) lin where lin.linha ><= 8 )

Isso deve resolver seu caso:

select lin.*
from ( SELECT * FROM (SELECT DISTINCT o.STORAGE_TYPE, COUNT(o.QUANTIDADE) as 
                             qtd_materiais, rownum as linha   
                      FROM mopsao.vw_monitoramento_do@MOPSAO m INNER JOIN V 
                      IEW_ORDENS_A_COLETAR o 
                      ON 
                      m.DELIVERY = o.DELIVERY AND m.cod_mat_c = o.MATERIAL WHERE 
                      m.status_andamento = 'Pickado' 
                      GROUP BY o.STORAGE_TYPE ORDER BY qtd_materiais DESC) lin
where lin.linha <= 8

fazer o mesmo script pegando as linhas > 8 ( lin.linha > 8 )

Isso deve resolver seu caso: SELECT lin.* FROM (SELECT DISTINCT o.STORAGE_TYPE, COUNT(o.QUANTIDADE) as qtd_materiais, rownum as linha
FROM mopsao.vw_monitoramento_do@MOPSAO m INNER JOIN V IEW_ORDENS_A_COLETAR o ON m.DELIVERY = o.DELIVERY AND m.cod_mat_c = o.MATERIAL WHERE m.status_andamento = 'Pickado' GROUP BY o.STORAGE_TYPE ORDER BY qtd_materiais DESC) lin where lin.linha <= 8

adicionou 42 caracteres ao conteúdo
Fonte Link
João Martins
  • 5,7mil
  • 5
  • 16
  • 33

Isso deve resolver seu caso: select lin.* from ( SELECT * FROM (SELECT DISTINCT o.STORAGE_TYPE, COUNT(o.QUANTIDADE) as qtd_materiais, rownum as linha
FROM mopsao.vw_monitoramento_do@MOPSAO m INNER JOIN V IEW_ORDENS_A_COLETAR o ON m.DELIVERY = o.DELIVERY AND m.cod_mat_c = o.MATERIAL WHERE m.status_andamento = 'Pickado' GROUP BY o.STORAGE_TYPE ORDER BY qtd_materiais DESC) lin where lin.linha <= 8

select lin.*
from ( SELECT * FROM (SELECT DISTINCT o.STORAGE_TYPE, COUNT(o.QUANTIDADE) as 
                             qtd_materiais, rownum as linha   
                      FROM mopsao.vw_monitoramento_do@MOPSAO m INNER JOIN V 
                      IEW_ORDENS_A_COLETAR o 
                      ON 
                      m.DELIVERY = o.DELIVERY AND m.cod_mat_c = o.MATERIAL WHERE 
                      m.status_andamento = 'Pickado' 
                      GROUP BY o.STORAGE_TYPE ORDER BY qtd_materiais DESC) lin
where lin.linha <= 8

fazer o mesmo script pegando as linhas > 8 ( lin.linha > 8 )

Isso deve resolver seu caso: select lin.* from ( SELECT * FROM (SELECT DISTINCT o.STORAGE_TYPE, COUNT(o.QUANTIDADE) as qtd_materiais, rownum as linha
FROM mopsao.vw_monitoramento_do@MOPSAO m INNER JOIN V IEW_ORDENS_A_COLETAR o ON m.DELIVERY = o.DELIVERY AND m.cod_mat_c = o.MATERIAL WHERE m.status_andamento = 'Pickado' GROUP BY o.STORAGE_TYPE ORDER BY qtd_materiais DESC) lin where lin.linha <= 8

fazer o mesmo script pegando as linhas > 8 ( lin.linha > 8 )

Isso deve resolver seu caso:

select lin.*
from ( SELECT * FROM (SELECT DISTINCT o.STORAGE_TYPE, COUNT(o.QUANTIDADE) as 
                             qtd_materiais, rownum as linha   
                      FROM mopsao.vw_monitoramento_do@MOPSAO m INNER JOIN V 
                      IEW_ORDENS_A_COLETAR o 
                      ON 
                      m.DELIVERY = o.DELIVERY AND m.cod_mat_c = o.MATERIAL WHERE 
                      m.status_andamento = 'Pickado' 
                      GROUP BY o.STORAGE_TYPE ORDER BY qtd_materiais DESC) lin
where lin.linha <= 8

fazer o mesmo script pegando as linhas > 8 ( lin.linha > 8 )

conteúdo editado
Fonte Link
Kleudy Silva
  • 101
  • 1
  • 1
  • 4

Isso deve resolver seu caso: select lin.* from ( SELECT * FROM (SELECT DISTINCT o.STORAGE_TYPE, COUNT(o.QUANTIDADE) as qtd_materiais, rownum as linha
FROM mopsao.vw_monitoramento_do@MOPSAO m INNER JOIN V IEW_ORDENS_A_COLETAR o ON m.DELIVERY = o.DELIVERY AND m.cod_mat_c = o.MATERIAL WHERE m.status_andamento = 'Pickado' GROUP BY o.STORAGE_TYPE ORDER BY qtd_materiais DESC) lin where lin.linha <= 8

fazer o mesmo script pegando as linhas <> 8 ( lin.linha > 8 )

Isso deve resolver seu caso: select lin.* from ( SELECT * FROM (SELECT DISTINCT o.STORAGE_TYPE, COUNT(o.QUANTIDADE) as qtd_materiais, rownum as linha
FROM mopsao.vw_monitoramento_do@MOPSAO m INNER JOIN V IEW_ORDENS_A_COLETAR o ON m.DELIVERY = o.DELIVERY AND m.cod_mat_c = o.MATERIAL WHERE m.status_andamento = 'Pickado' GROUP BY o.STORAGE_TYPE ORDER BY qtd_materiais DESC) lin where lin.linha <= 8

fazer o mesmo script pegando as linhas < 8 ( lin.linha > 8 )

Isso deve resolver seu caso: select lin.* from ( SELECT * FROM (SELECT DISTINCT o.STORAGE_TYPE, COUNT(o.QUANTIDADE) as qtd_materiais, rownum as linha
FROM mopsao.vw_monitoramento_do@MOPSAO m INNER JOIN V IEW_ORDENS_A_COLETAR o ON m.DELIVERY = o.DELIVERY AND m.cod_mat_c = o.MATERIAL WHERE m.status_andamento = 'Pickado' GROUP BY o.STORAGE_TYPE ORDER BY qtd_materiais DESC) lin where lin.linha <= 8

fazer o mesmo script pegando as linhas > 8 ( lin.linha > 8 )

Fonte Link
Kleudy Silva
  • 101
  • 1
  • 1
  • 4
Carregando