AlbertMourato

Untitled

Nov 23rd, 2015
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 0.36 KB | None | 0 0
  1. DECLARE
  2. aux cliente_type;
  3. BEGIN
  4.   SELECT DEREF(cl.cliente) INTO aux FROM(
  5.     SELECT ct.cliente FROM Carregar_table ct
  6.       WHERE ct.auxiliar.supervisor.cpf = '211.111.11115'
  7.         GROUP BY ct.auxiliar
  8.         ORDER BY COUNT(ct.carga) DESC
  9.   )cl WHERE ROWNUM = 1;
  10.   dbms_output.put_line('nome '|| aux.nome||' cnpj '||aux.cnpj||' cep '||aux.cep);
  11. END;
  12. /
Advertisement
Add Comment
Please, Sign In to add comment