Advertisement
Fhernd

Consulta2.sql

Sep 5th, 2014
365
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SELECT NOMBRE  AS NOMBRE_TABLA ,TIPO  AS TIPO_DATO_COL , NVL(NUMERO_DE_RESTRICCIONES, ) ,NUMERO_DE_COLUMNAS
  2. FROM (
  3. SELECT TABLE_NAME AS NOMBRE  ,DATA_TYPE AS TIPO  ,COUNT(*) AS NUMERO_DE_COLUMNAS
  4. FROM all_tab_columns
  5. WHERE OWNER = 'PARRANDEROS'
  6. GROUP BY DATA_TYPE,TABLE_NAME
  7. ORDER BY TABLE_NAME)
  8. FULL OUTER JOIN (
  9. SELECT TABLE_NAME AS NOMBRE  ,DATA_TYPE AS DATOS  ,COUNT(*) AS NUMERO_DE_RESTRICCIONES
  10. FROM ALL_TAB_COLUMNS atc
  11. WHERE OWNER = 'PARRANDEROS' AND atc NULLABLE = 'N'
  12. GROUP BY DATA_TYPE, TABLE_NAME
  13. ORDER BY TABLE_NAME )
  14. ON ( NOMBRE  = NOMBRE  AND TIPO  = DATOS  )
  15. ORDER BY NOMBRE ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement