Tag: analytics

LAG / LEAD quick tip

As most of us know, with LAG and LEAD or more generally, any analytic function that may extend “past” the boundary of window it is operating on, you can get null as a result. Here’s a trivial example SQL> create table t as 2…

Histograms on data (not the optimizer)

I’ve been doing a series on Analytics here but if you need to group data into ranges, you don’t necessarily need a fancy analytic. The function WIDTH_BUCKET can easily determine histogram groupings within a table. SQL> SELECT CUST_ID, CUST_LAST_NAME, CUST_CREDIT_LIMIT, 2 WIDTH_BUCKET(CUST_CREDIT_LIMIT, 100, 5000,…

KISS video series for Analytic functions

Analytic functions still bamboozle many SQL practitioners out there.  So I’m building a suite of videos to walk people through some of the common questions we get asked that we need to solve with SQL, and look at how we can often solve them…

Analytics Demo Scripts

Video 2: Ranking rows https://livesql.oracle.com/apex/livesql/s/ch1tefsz0mc75pk4ix2jbfja7 Video 3: More options for ranking rows https://livesql.oracle.com/apex/livesql/s/clebs8f5n4kr2b3vjvnvvgxkn Video 4: Using the Tabibitosan method for grouping sets of rows https://livesql.oracle.com/apex/livesql/s/cljrgh80cczwjtptlpk2e5081 Video 5: CUME_DIST, PERCENT_RANK and NTILE https://livesql.oracle.com/apex/livesql/s/clq6jmj1jzju4k23v3tnbzo8u Video 6: Dealing with NULLS https://livesql.oracle.com/apex/livesql/s/cokpdete3hiy3jo0yzoa4eerz Video 7: Analytics as predicates https://livesql.oracle.com/apex/livesql/s/cokv9220ffzt8iqs7udqsv5vm…