my code stock.com

koddasasd

Snippet options

Download: Download snippet as kod.sql.
Copy snippet: For this you need a free my code stock.com account.
Embed code : You will find the embed code for this snippet at the end of the page, if you want to embed it into a website or a blog!

/* Formatted on 12.13.2012 11:49:02 (QP5 v5.227.12220.39724) */
--select /*+parallel*/ count(*) from OTOTEST_SAMPLE_TRG_LOCAL where co_id > 400000;

SELECT                                                    /* PARALLEL (r,8) */
      COLUMN_STAT_SEQ.NEXTVAL COLUMN_STAT_ID, 8 MODULE_DATA_ID, r.*
  FROM ((WITH SOURCE_TABLE
              AS (SELECT * /*+ parallel(q,8) */
                    FROM OTOTEST_SAMPLE_TRG_LOCAL q
                   WHERE co_id > 400000)
         (SELECT 'CO_ID' COLUMN_NAME,
                 SYSDATE TS,
                 T3.ROW_COUNT COUNT,
                 T2.*,
                 T3.NULL_COUNT NULL_COUNT,
                 T3.NULL_COUNT * 100 / T3.ROW_COUNT NULL_PERCENT,
                 NULL NUMERIC_COUNT,
                 NULL ALNUM_COUNT,
                 NULL BLANK_COUNT,
                 (SELECT /*+ parallel(t1,8) */
                        COUNT (*)
                    FROM SOURCE_TABLE t1
                   WHERE CO_ID < 0)
                    NEGATIVE_COUNT
            FROM (SELECT /*+ parallel(t2,8) */
                        TO_CHAR (MIN (CO_ID)) MINIMUM,
                         TO_CHAR (MAX (CO_ID)) MAXIMUM,
                         (MAX (CO_ID) - MIN (CO_ID)) RANGE,
                         VARIANCE (CO_ID) VARIANCE,
                         STDDEV (CO_ID) STDDEV
                    FROM SOURCE_TABLE
                   WHERE 1 = 1) t2,
                 (SELECT *
                    FROM (SELECT /*+ parallel(t1,8) */
                                COUNT (CO_ID) ROW_COUNT
                            FROM SOURCE_TABLE t1
                           WHERE 1 = 1),
                         (SELECT /*+ parallel(t1,8) */
                                COUNT (*) NULL_COUNT
                            FROM SOURCE_TABLE t1
                           WHERE t1.CO_ID IS NULL)) t3)
         UNION ALL
         (SELECT 'TMCODE' COLUMN_NAME,
                 SYSDATE TS,
                 T3.ROW_COUNT COUNT,
                 T2.*,
                 T3.NULL_COUNT NULL_COUNT,
                 T3.NULL_COUNT * 100 / T3.ROW_COUNT NULL_PERCENT,
                 NULL NUMERIC_COUNT,
                 NULL ALNUM_COUNT,
                 NULL BLANK_COUNT,
                 (SELECT /*+ parallel(t1,8) */
                        COUNT (*)
                    FROM SOURCE_TABLE t1
                   WHERE TMCODE < 0)
                    NEGATIVE_COUNT
            FROM (SELECT /*+ parallel(t2,8) */
                        TO_CHAR (MIN (TMCODE)) MINIMUM,
                         TO_CHAR (MAX (TMCODE)) MAXIMUM,
                         (MAX (TMCODE) - MIN (TMCODE)) RANGE,
                         VARIANCE (TMCODE) VARIANCE,
                         STDDEV (TMCODE) STDDEV
                    FROM SOURCE_TABLE
                   WHERE 1 = 1) t2,
                 (SELECT *
                    FROM (SELECT /*+ parallel(t1,8) */
                                COUNT (TMCODE) ROW_COUNT
                            FROM SOURCE_TABLE t1
                           WHERE 1 = 1),
                         (SELECT /*+ parallel(t1,8) */
                                COUNT (*) NULL_COUNT
                            FROM SOURCE_TABLE t1
                           WHERE t1.TMCODE IS NULL)) t3)
         UNION ALL
         (SELECT 'SNCODE' COLUMN_NAME,
                 SYSDATE TS,
                 T3.ROW_COUNT COUNT,
                 T2.*,
                 T3.NULL_COUNT NULL_COUNT,
                 T3.NULL_COUNT * 100 / T3.ROW_COUNT NULL_PERCENT,
                 NULL NUMERIC_COUNT,
                 NULL ALNUM_COUNT,
                 NULL BLANK_COUNT,
                 (SELECT /*+ parallel(t1,8) */
                        COUNT (*)
                    FROM SOURCE_TABLE t1
                   WHERE SNCODE < 0)
                    NEGATIVE_COUNT
            FROM (SELECT /*+ parallel(t2,8) */
                        TO_CHAR (MIN (SNCODE)) MINIMUM,
                         TO_CHAR (MAX (SNCODE)) MAXIMUM,
                         (MAX (SNCODE) - MIN (SNCODE)) RANGE,
                         VARIANCE (SNCODE) VARIANCE,
                         STDDEV (SNCODE) STDDEV
                    FROM SOURCE_TABLE
                   WHERE 1 = 1) t2,
                 (SELECT *
                    FROM (SELECT /*+ parallel(t1,8) */
                                COUNT (SNCODE) ROW_COUNT
                            FROM SOURCE_TABLE t1
                           WHERE 1 = 1),
                         (SELECT /*+ parallel(t1,8) */
                                COUNT (*) NULL_COUNT
                            FROM SOURCE_TABLE t1
                           WHERE t1.SNCODE IS NULL)) t3)
         UNION ALL
         (SELECT 'CS_DATE_BILLED' COLUMN_NAME,
                 SYSDATE TS,
                 T3.ROW_COUNT COUNT,
                 T2.*,
                 T3.NULL_COUNT NULL_COUNT,
                 T3.NULL_COUNT * 100 / T3.ROW_COUNT NULL_PERCENT,
                 NULL NUMERIC_COUNT,
                 NULL ALNUM_COUNT,
                 NULL BLANK_COUNT,
                 NULL NEGATIVE_COUNT
            FROM (SELECT /*+ parallel(t2,8) */
                        TO_CHAR (MIN (CS_DATE_BILLED)) MINIMUM,
                         TO_CHAR (MAX (CS_DATE_BILLED)) MAXIMUM,
                         NULL RANGE,
                         NULL VARIANCE,
                         NULL STDDEV
                    FROM SOURCE_TABLE
                   WHERE 1 = 1) t2,
                 (SELECT *
                    FROM (SELECT /*+ parallel(t1,8) */
                                COUNT (CS_DATE_BILLED) ROW_COUNT
                            FROM SOURCE_TABLE t1
                           WHERE 1 = 1),
                         (SELECT /*+ parallel(t1,8) */
                                COUNT (*) NULL_COUNT
                            FROM SOURCE_TABLE t1
                           WHERE t1.CS_DATE_BILLED IS NULL)) t3)
         UNION ALL
         (SELECT 'CS_ENTDATE' COLUMN_NAME,
                 SYSDATE TS,
                 T3.ROW_COUNT COUNT,
                 T2.*,
                 T3.NULL_COUNT NULL_COUNT,
                 T3.NULL_COUNT * 100 / T3.ROW_COUNT NULL_PERCENT,
                 NULL NUMERIC_COUNT,
                 NULL ALNUM_COUNT,
                 NULL BLANK_COUNT,
                 NULL NEGATIVE_COUNT
            FROM (SELECT /*+ parallel(t2,8) */
                        TO_CHAR (MIN (CS_ENTDATE)) MINIMUM,
                         TO_CHAR (MAX (CS_ENTDATE)) MAXIMUM,
                         NULL RANGE,
                         NULL VARIANCE,
                         NULL STDDEV
                    FROM SOURCE_TABLE
                   WHERE 1 = 1) t2,
                 (SELECT *
                    FROM (SELECT /*+ parallel(t1,8) */
                                COUNT (CS_ENTDATE) ROW_COUNT
                            FROM SOURCE_TABLE t1
                           WHERE 1 = 1),
                         (SELECT /*+ parallel(t1,8) */
                                COUNT (*) NULL_COUNT
                            FROM SOURCE_TABLE t1
                           WHERE t1.CS_ENTDATE IS NULL)) t3))) r

Create a free my code stock.com account now.

my code stok.com is a free service, which allows you to save and manage code snippes of any kind and programming language. We provide many advantages for your daily work with code-snippets, also for your teamwork. Give it a try!

Find out more and register now

You can customize the height of iFrame-Codes as needed! You can find more infos in our API Reference for iframe Embeds.