Unisoft Technologies

What’s new in Oracle SQL 23.26.4: a follow-along lab

Release Update 23.26.4 of Oracle AI Database 26ai added four new pieces of SQL. Here they are as I teach them: what each is for, how hard it is, and 25 steps to type, each with the exact output my lab printed on 23.26.4.

SQL*Plus, Oracle AI Database 26ai 23.26.4
SQL> SELECT ename, sal, BAR_CHART(sal/50) AS bar FROM emp ORDER BY sal;

ENAME             SAL BAR
---------- ---------- ----------
SMITH             800 █▋
JAMES             950 █▉
ADAMS            1100 ██▎
WARD             1250 ██▌
MARTIN           1250 ██▌
MILLER           1300 ██▋
TURNER           1500 ███
ALLEN            1600 ███▎
CLARK            2450 ████▉
BLAKE            2850 █████▊
JONES            2975 ██████
SCOTT            3000 ██████
FORD             3000 ██████
KING             5000 ██████████

14 rows selected.
BAR_CHART, new in 23.26.4, drawing a bar for each of SCOTT’s 14 employees. Real output from my lab.

The four features at a glance

  • SELECT * with other columns (beginner): put your own columns before or after *.
  • BAR_CHART (beginner): draw a bar for each row, right in the query result.
  • FETCH FIRST … FOR UPDATE SKIP LOCKED (advanced): let several sessions each take their own batch of rows.
  • TUMBLE, HOP, CUMULATE, SESSIONS (advanced): group rows into time windows.

Beginners: do parts 1 and 2. After transactions and analytic functions: parts 3 and 4.

0 steps done

Before you start: your lab

You need Oracle AI Database 26ai at release 23.26.4 or later. The free edition, Oracle AI Database 26ai Free, is enough; it is what I used. Connect as SCOTT, the sample schema, in the pluggable database FREEPDB1: sqlplus scott@freepdb1. If your database has no SCOTT, Oracle ships the script that creates it as rdbms/admin/scott.sql in the Oracle home; ask your trainer before running it.

  1. Check your release

    Every feature on this page needs 23.26.4. On an older release the steps fail with errors.

    Type this
    SELECT banner_full FROM v$version;
    You should see (23.26.4)
    BANNER_FULL
    ------------------------------------------------------------------------------------------------------------------------------------------------------
    Oracle AI Database 26ai Free Release 23.26.4.0.0 - Develop, Learn, and Run for Free
    Version 23.26.4.0.0
    
    1 row selected.

    What to notice: the second line must say 23.26.4 or higher. If it says 23.26.3 or lower, update the database first.

I ran every step below on Oracle AI Database 26ai Free 23.26.4.0.0 on 30 November 2026, as SCOTT in FREEPDB1, with SET LINESIZE 150 and SET PAGESIZE 100. Each “You should see” box is that run’s output, unchanged. Tick each step as you finish it; your ticks stay in this browser only.

1. SELECT * beside other columns

Beginner

Purpose: add a calculated column next to every column, without typing each column out.

Before 23.26.4, a bare * could not share the select list with anything else; you had to write the table’s name or alias in front, as in e.*. Now the star can stand anywhere in the list, and every item you write keeps its place.

Build a select list

Click the items in the order you want them, then read the columns you get back from EMP.

Your query

SELECT sal * 12 AS annual_sal, * FROM emp;

The columns you get
  • ANNUAL_SAL
  • EMPNO
  • ENAME
  • JOB
  • MGR
  • HIREDATE
  • SAL
  • COMM
  • DEPTNO

New in 23.26.4: your items stay where you put them and * fills in every EMP column at its place.

  1. Put a calculated column in front of everything

    Ask for the yearly salary, then every column of EMP, for department 10.

    Type this
    SELECT sal * 12 AS annual_sal, * FROM emp WHERE deptno = 10;
    You should see (23.26.4)
    ANNUAL_SAL      EMPNO ENAME      JOB              MGR HIREDATE                  SAL       COMM     DEPTNO
    ---------- ---------- ---------- --------- ---------- ------------------ ---------- ---------- ----------
         29400       7782 CLARK      MANAGER         7839 09-JUN-81                2450                    10
         60000       7839 KING       PRESIDENT            17-NOV-81                5000                    10
         15600       7934 MILLER     CLERK           7782 23-JAN-82                1300                    10
    
    3 rows selected.

    What to notice: ANNUAL_SAL comes first because you wrote it first; the * expanded to all eight EMP columns after it.

  2. Put * in the middle

    Items can go before and after the star.

    Type this
    SELECT deptno, *, 'end' AS marker FROM dept;
    You should see (23.26.4)
        DEPTNO     DEPTNO DNAME          LOC           MAR
    ---------- ---------- -------------- ------------- ---
            10         10 ACCOUNTING     NEW YORK      end
            20         20 RESEARCH       DALLAS        end
            30         30 SALES          CHICAGO       end
            40         40 OPERATIONS     BOSTON        end
    
    4 rows selected.

    What to notice: DEPTNO appears twice, the one you listed and the one inside *. Oracle allows it. If a program reads columns by name, give one of them an alias.

  3. Use it with a join

    A bare star in a join expands every column of both tables.

    Type this
    SELECT e.ename, * FROM emp e JOIN dept d ON d.deptno = e.deptno WHERE e.empno = 7839;
    You should see (23.26.4)
    ENAME           EMPNO ENAME      JOB              MGR HIREDATE                  SAL       COMM     DEPTNO     DEPTNO DNAME          LOC
    ---------- ---------- ---------- --------- ---------- ------------------ ---------- ---------- ---------- ---------- -------------- -------------
    KING             7839 KING       PRESIDENT            17-NOV-81                5000                    10         10 ACCOUNTING     NEW YORK
    
    1 row selected.

    What to notice: ENAME first, then all eight EMP columns, then all three DEPT columns. Write e.* or d.* when you want one table only.

Try it yourself: the bonus column

Show every DEPT column followed by a column called CITY_CODE holding the first three letters of LOC.

Show one answer
One answer
SELECT *, SUBSTR(loc, 1, 3) AS city_code
FROM   dept;

Four rows: DEPTNO, DNAME, LOC, then CITY_CODE (NEW, DAL, CHI, BOS).

2. BAR_CHART: a bar for every row

Beginner

Purpose: see the shape of your data in the result itself, with no Excel or BI tool.

BAR_CHART(value, maximum, minimum, width, symbol) returns a string of characters as long as the value is big. Only the value is required. If you give an argument, give every one before it too. The defaults are a maximum of 100, a minimum of 0 and a width of 10.

BAR_CHART playground

Change any argument. The bar is drawn the way 23.26.4 drew SCOTT’s salaries in steps 5 and 6; try a preset first.

The result, in square brackets so you can see the padding

BAR_CHART(2450, 5000, 0, 20, '#')

  1. A bar for each salary

    Scale the bar from 0 to 5000, 20 characters wide, drawn with #. COLUMN just sets the display width in SQL*Plus.

    Type this
    COLUMN chart FORMAT A20
    SELECT ename, sal, BAR_CHART(sal, 5000, 0, 20, '#') AS chart FROM emp ORDER BY sal;
    You should see (23.26.4)
    ENAME             SAL CHART
    ---------- ---------- --------------------
    SMITH             800 ###
    JAMES             950 ####
    ADAMS            1100 ####
    WARD             1250 #####
    MARTIN           1250 #####
    MILLER           1300 #####
    TURNER           1500 ######
    ALLEN            1600 ######
    CLARK            2450 ##########
    BLAKE            2850 ###########
    JONES            2975 ############
    SCOTT            3000 ############
    FORD             3000 ############
    KING             5000 ####################
    
    14 rows selected.

    What to notice: KING earns the maximum, 5000, so his bar is the full 20 characters. SMITH’s 800 is 3.2 characters, shown as 3.

  2. Let BAR_CHART use its defaults

    Give only the value. The default scale is 0 to 100 and the default width is 10 characters, so I divide by 50 to bring the salaries into that range.

    Type this
    COLUMN bar FORMAT A10
    SELECT ename, sal, BAR_CHART(sal/50) AS bar FROM emp ORDER BY sal;
    You should see (23.26.4)
    ENAME             SAL BAR
    ---------- ---------- ----------
    SMITH             800 █▋
    JAMES             950 █▉
    ADAMS            1100 ██▎
    WARD             1250 ██▌
    MARTIN           1250 ██▌
    MILLER           1300 ██▋
    TURNER           1500 ███
    ALLEN            1600 ███▎
    CLARK            2450 ████▉
    BLAKE            2850 █████▊
    JONES            2975 ██████
    SCOTT            3000 ██████
    FORD             3000 ██████
    KING             5000 ██████████
    
    14 rows selected.

    What to notice: in a UTF-8 database the default symbol draws solid blocks, and part blocks for fractions: SMITH’s 1.6 characters is one block and a bit more than half.

  3. Chart a GROUP BY

    BAR_CHART takes any number, including an aggregate.

    Type this
    SELECT deptno, ROUND(AVG(sal)) AS avg_sal, BAR_CHART(AVG(sal), 5000, 0, 20, '#') AS chart FROM emp GROUP BY deptno ORDER BY deptno;
    You should see (23.26.4)
        DEPTNO    AVG_SAL CHART
    ---------- ---------- --------------------
            10       2917 ############
            20       2175 #########
            30       1567 ######
    
    3 rows selected.
  4. Chart a TRUE or FALSE

    Give it a condition and it draws one block for TRUE and a space for FALSE. The square brackets are only there so you can see the space.

    Type this
    SELECT ename, comm, '[' || BAR_CHART(comm IS NOT NULL) || ']' AS has_comm FROM emp WHERE deptno = 30;
    You should see (23.26.4)
    ENAME            COMM HAS_COMM
    ---------- ---------- ------------
    ALLEN             300 [█]
    WARD              500 [█]
    MARTIN           1400 [█]
    BLAKE                 [ ]
    TURNER              0 [█]
    JAMES                 [ ]
    
    6 rows selected.

    What to notice: TURNER’s commission is 0, which is NOT NULL, so he gets a block. BLAKE and JAMES have no commission at all.

  5. The argument order trap

    The second argument is the maximum, the third the minimum. Swap them on purpose.

    Type this
    COLUMN swapped FORMAT A12
    COLUMN right_order FORMAT A12
    SELECT '[' || BAR_CHART(50, 0, 100, 10, '#') || ']' AS swapped, '[' || BAR_CHART(50, 100, 0, 10, '#') || ']' AS right_order FROM dual;
    You should see (23.26.4)
    SWAPPED      RIGHT_ORDER
    ------------ ------------
    []           [#####     ]
    
    1 row selected.

    What to notice: with the maximum below the minimum, BAR_CHART returns NULL: the empty brackets. No error, just nothing. Most students get this wrong the first time.

Try it yourself: chart the commission

For the salesmen, draw COMM on a 0 to 1500 scale, 15 characters wide, with *.

Show one answer
One answer
SELECT ename, comm,
       BAR_CHART(comm, 1500, 0, 15, '*') AS chart
FROM   emp
WHERE  job = 'SALESMAN'
ORDER  BY comm;

MARTIN’s 1400 is the longest bar, 14 characters. TURNER’s 0 gives a bar of spaces, which is not the same as NULL: a NULL value gives NULL.

3. FETCH FIRST with FOR UPDATE SKIP LOCKED

Advanced

Purpose: let several sessions each lock their own batch of rows without waiting on one another. The classic job-queue pattern.

Picture a bank with several counters and one pile of token slips. Each clerk takes the next few slips that nobody else is holding. If clerk A is holding slips 1 to 10, clerk B should take 11 to 15, not stand and wait. That is what SKIP LOCKED does, and from 23.26.4 you can combine it with FETCH FIRST n ROWS ONLY to say how many.

You will need two SQL*Plus windows for this part, both connected as SCOTT. I mark each step with the window to type it in. Try the idea in the machine first.

Two windows, one queue

Thirty new orders. Lock some from window A, then see what window B gets with SKIP LOCKED and with NOWAIT.

  • Locked by window A
  • Locked by window B
  • Done (committed)
  • New

    Window A

    Window B

    1. Window AMake a queue of 30 orders

      Open two SQL*Plus windows, both connected as SCOTT. In window A, create the queue.

      Type this
      CREATE TABLE ru4_queue (order_id NUMBER PRIMARY KEY, status VARCHAR2(10));
      INSERT INTO ru4_queue SELECT level, 'NEW' FROM dual CONNECT BY level <= 30;
      COMMIT;
      You should see (23.26.4)
      Table created.
      
      30 rows created.
      
      Commit complete.
    2. Window ATake ten orders and keep them

      Still in window A, lock the first ten new orders. This is the new part: a row limit and FOR UPDATE in one query. Do not commit.

      Type this
      SELECT order_id FROM ru4_queue WHERE status = 'NEW' ORDER BY order_id FETCH FIRST 10 ROWS ONLY FOR UPDATE;
      You should see (23.26.4)
        ORDER_ID
      ----------
               1
               2
               3
               4
               5
               6
               7
               8
               9
              10
      
      10 rows selected.

      What to notice: window A now holds row locks on orders 1 to 10 until it commits or rolls back.

    3. Window BAsk for five orders, skipping locked ones

      Switch to window B and ask for five.

      Type this
      SELECT order_id FROM ru4_queue WHERE status = 'NEW' ORDER BY order_id FETCH FIRST 5 ROWS ONLY FOR UPDATE SKIP LOCKED;
      You should see (23.26.4)
        ORDER_ID
      ----------
              11
              12
              13
              14
              15
      
      5 rows selected.

      What to notice: B got 11 to 15 straight away. Orders 1 to 10 were skipped, and they did not count toward the five.

    4. Window BNow ask with NOWAIT instead

      In window B, release your five with ROLLBACK, then ask again with NOWAIT.

      Type this
      ROLLBACK;
      SELECT order_id FROM ru4_queue WHERE status = 'NEW' ORDER BY order_id FETCH FIRST 5 ROWS ONLY FOR UPDATE NOWAIT;
      You should see (23.26.4)
      Rollback complete.
      
      SELECT order_id FROM ru4_queue WHERE status = 'NEW' ORDER BY order_id FETCH FIRST 5 ROWS ONLY FOR UPDATE NOWAIT
                           *
      ERROR at line 1:
      ORA-00054: Failed to acquire a lock (Type: "TX", Name: "Transaction", Description: "Lock held by a transaction to allow
      other transactions to wait for it") because it is currently held by another session. The resource being locked can be
      identified by 131086 ("usn<<16 | slot") and 559 ("sequence")
      ORA-40097: Failure to acquire row lock, currently held by transaction ID 2.14.559
      Help: https://docs.oracle.com/error-help/db/ora-00054/

      What to notice: NOWAIT tried orders 1 to 5, found them locked by window A and failed at once. Without SKIP LOCKED or NOWAIT, window B would simply wait.

    5. Window AFinish the work in window A

      Back in window A, mark the ten orders done and commit. That releases the locks.

      Type this
      UPDATE ru4_queue SET status = 'DONE' WHERE order_id <= 10;
      COMMIT;
      You should see (23.26.4)
      10 rows updated.
      
      Commit complete.
    6. Window BAsk again from window B

      Orders 1 to 10 are DONE now, so they no longer match status = ’NEW’.

      Type this
      SELECT order_id FROM ru4_queue WHERE status = 'NEW' ORDER BY order_id FETCH FIRST 5 ROWS ONLY FOR UPDATE SKIP LOCKED;
      You should see (23.26.4)
        ORDER_ID
      ----------
              11
              12
              13
              14
              15
      
      5 rows selected.

      What to notice: 11 to 15 again, this time because they are the first new orders, not because anything is locked. Type ROLLBACK; to release them.

    7. The two limits Oracle refuses

      A row limit with FOR UPDATE must be a row count with ONLY. Try the other two forms on the same queue.

      Type this
      SELECT order_id FROM ru4_queue FETCH FIRST 10 PERCENT ROWS ONLY FOR UPDATE;
      SELECT order_id FROM ru4_queue ORDER BY status FETCH FIRST 5 ROWS WITH TIES FOR UPDATE;
      You should see (23.26.4)
      SELECT order_id FROM ru4_queue FETCH FIRST 10 PERCENT ROWS ONLY FOR UPDATE
                                                                      *
      ERROR at line 1:
      ORA-01786: FOR UPDATE cannot be used with FETCH PERCENT ROWS
      Help: https://docs.oracle.com/error-help/db/ora-01786/
      
      SELECT order_id FROM ru4_queue ORDER BY status FETCH FIRST 5 ROWS WITH TIES FOR UPDATE
                                                                                  *
      ERROR at line 1:
      ORA-01786: FOR UPDATE cannot be used with FETCH ROWS WITH TIES
      Help: https://docs.oracle.com/error-help/db/ora-01786/

    4. Time windows: TUMBLE, HOP, CUMULATE and SESSIONS

    Advanced

    Purpose: group events into time buckets: orders per hour, overlapping or growing windows, and visits split into sessions.

    These four are table functions: you use them in the FROM clause, where a table would go. Each returns your rows plus two new columns, WINDOW_START and WINDOW_END, and you group by those. The time column goes inside COLUMNS( ), and must be a plain DATE or TIMESTAMP column, not an expression.

    See the windows

    The white dots are the 30 orders of step 17, one every 7 minutes from 09:00. Each red bar is one window, with its count.

    1. Make 30 orders, one every 7 minutes

      Orders from 09:00 to 12:23 with an amount each. One window is enough for this feature.

      Type this
      CREATE TABLE ru4_orders (
        order_id   NUMBER PRIMARY KEY,
        status     VARCHAR2(10) NOT NULL,
        amount     NUMBER(8,2),
        order_time TIMESTAMP NOT NULL
      );
      INSERT INTO ru4_orders
      SELECT level, 'NEW', 100 + MOD(level * 37, 900),
             TIMESTAMP '2026-11-30 09:00:00' + NUMTODSINTERVAL((level - 1) * 7, 'MINUTE')
      FROM dual CONNECT BY level <= 30;
      COMMIT;
      You should see (23.26.4)
      Table created.
      
      30 rows created.
      
      Commit complete.
    2. Show times as hours and minutes

      These SQL*Plus settings only change how the times are printed, so the windows fit on screen.

      Type this
      ALTER SESSION SET NLS_TIMESTAMP_FORMAT = 'HH24:MI';
      COLUMN order_time FORMAT A10
      COLUMN window_start FORMAT A12
      COLUMN window_end FORMAT A10
      SELECT order_id, order_time, amount FROM ru4_orders WHERE order_id <= 4 OR order_id >= 29 ORDER BY order_id;
      You should see (23.26.4)
      Session altered.
      
        ORDER_ID ORDER_TIME     AMOUNT
      ---------- ---------- ----------
               1 09:00             137
               2 09:07             174
               3 09:14             211
               4 09:21             248
              29 12:16             273
              30 12:23             310
      
      6 rows selected.
    3. Hourly totals with TUMBLE

      TUMBLE takes the table, the time column in COLUMNS( ), and the window size. It adds WINDOW_START and WINDOW_END to every row, so you group by them.

      Type this
      SELECT window_start, window_end, COUNT(*) AS orders, SUM(amount) AS total
      FROM   TUMBLE(ru4_orders, COLUMNS(order_time), INTERVAL '1' HOUR)
      GROUP  BY window_start, window_end
      ORDER  BY window_start;
      You should see (23.26.4)
      WINDOW_START WINDOW_END     ORDERS      TOTAL
      ------------ ---------- ---------- ----------
      09:00        10:00               9       2565
      10:00        11:00               9       5562
      11:00        12:00               8       5660
      12:00        13:00               4       1018
      
      4 rows selected.

      What to notice: 9 + 9 + 8 + 4 = 30. Every order is in exactly one window.

    4. Check the edges

      Look at three orders either side of 10:00.

      Type this
      SELECT order_id, order_time, window_start, window_end
      FROM   TUMBLE(ru4_orders, COLUMNS(order_time), INTERVAL '1' HOUR)
      WHERE  order_id BETWEEN 8 AND 10
      ORDER  BY order_id;
      You should see (23.26.4)
        ORDER_ID ORDER_TIME WINDOW_START WINDOW_END
      ---------- ---------- ------------ ----------
               8 09:49      09:00        10:00
               9 09:56      09:00        10:00
              10 10:03      10:00        11:00
      
      3 rows selected.

      What to notice: a window includes its start and excludes its end, so 09:56 is in the 09:00 window and 10:03 in the 10:00 one. An order at exactly 10:00 would go in the 10:00 window.

    5. Overlapping windows with HOP

      HOP takes the slide first, then the size: a new 1-hour window every 30 minutes.

      Type this
      SELECT window_start, window_end, COUNT(*) AS orders
      FROM   HOP(ru4_orders, COLUMNS(order_time), INTERVAL '30' MINUTE, INTERVAL '1' HOUR)
      GROUP  BY window_start, window_end
      ORDER  BY window_start;
      You should see (23.26.4)
      WINDOW_START WINDOW_END     ORDERS
      ------------ ---------- ----------
      08:30        09:30               5
      09:00        10:00               9
      09:30        10:30               8
      10:00        11:00               9
      10:30        11:30               9
      11:00        12:00               8
      11:30        12:30               8
      12:00        13:00               4
      
      8 rows selected.

      What to notice: the first window starts at 08:30, before the first order. Windows line up with the clock, not with your data. The counts add up to 60: every order is in two windows.

    6. Growing windows with CUMULATE

      CUMULATE takes the step, then the maximum size: windows that start together and grow by 30 minutes up to 2 hours.

      Type this
      SELECT window_start, window_end, COUNT(*) AS orders
      FROM   CUMULATE(ru4_orders, COLUMNS(order_time), INTERVAL '30' MINUTE, INTERVAL '2' HOUR)
      GROUP  BY window_start, window_end
      ORDER  BY window_start, window_end;
      You should see (23.26.4)
      WINDOW_START WINDOW_END     ORDERS
      ------------ ---------- ----------
      08:00        09:30               5
      08:00        10:00               9
      10:00        10:30               4
      10:00        11:00               9
      10:00        11:30              13
      10:00        12:00              17
      12:00        12:30               4
      12:00        13:00               4
      12:00        13:30               4
      12:00        14:00               4
      
      10 rows selected.

      What to notice: the windows start at 08:00, 10:00 and 12:00, the clock’s 2-hour marks. Inside each, the count only grows: 4, 9, 13, 17. That is a running total per 2-hour block.

    7. Make a quiet gap

      Delete four orders so there is a 35-minute pause between 10:03 and 10:38.

      Type this
      DELETE FROM ru4_orders WHERE order_id BETWEEN 11 AND 14;
      COMMIT;
      You should see (23.26.4)
      4 rows deleted.
      
      Commit complete.
    8. Split the day into sessions

      SESSIONS takes one interval: the gap that ends a session.

      Type this
      SELECT window_start, window_end, COUNT(*) AS orders
      FROM   SESSIONS(ru4_orders, COLUMNS(order_time), INTERVAL '20' MINUTE)
      GROUP  BY window_start, window_end
      ORDER  BY window_start;
      You should see (23.26.4)
      WINDOW_START WINDOW_END     ORDERS
      ------------ ---------- ----------
      09:00        10:23              10
      10:38        12:43              16
      
      2 rows selected.

      What to notice: two sessions, of 10 and 16 orders. Each WINDOW_END is the last order plus the 20-minute gap: 10:03 + 20 = 10:23.

    Try it yourself: orders per 90 minutes

    Count the orders in 90-minute TUMBLE windows. Before you run it, guess where the first window starts.

    Show one answer
    One answer
    SELECT window_start, window_end, COUNT(*) AS orders
    FROM   TUMBLE(ru4_orders, COLUMNS(order_time), INTERVAL '90' MINUTE)
    GROUP  BY window_start, window_end
    ORDER  BY window_start;

    Run it before step 23 or after, and compare: step 23 deletes four orders. Look at the first WINDOW_START and decide whether the window lined up with your first order or with the clock.

    When you are done

    1. Clean up

      Drop the two tables the lab created. SCOTT’s own tables are not touched.

      Type this
      DROP TABLE ru4_queue PURGE;
      DROP TABLE ru4_orders PURGE;
      You should see (23.26.4)
      Table dropped.
      
      Table dropped.

    Teaching this in class

    Test yourself

    Ten questions, all from this lab. Pick an answer to see why.

    1. Which of these runs on 23.26.4 but fails on older releases?

    2. In SELECT deptno, *, ’end’ AS marker FROM dept, which column comes first?

    3. BAR_CHART(sal, 5000, 0, 20, ’#’): what is the 5000?

    4. With no options, BAR_CHART(x) draws…

    5. Window A holds orders 1 to 10. Window B runs FETCH FIRST 5 ROWS ONLY FOR UPDATE SKIP LOCKED. What does B get?

    6. Same situation, but B uses NOWAIT instead of SKIP LOCKED. What happens?

    7. Which of these is refused with FOR UPDATE?

    8. An order placed at exactly 10:00, with one-hour TUMBLE windows, goes into…

    9. The first order was at 09:00. Why did the 2-hour CUMULATE window start at 08:00?

    10. Which function splits rows into sessions after a quiet gap?

    Questions students ask

    What is new in Oracle SQL 23.26.4?

    Release Update 23.26.4 of Oracle AI Database 26ai added four SQL features worth teaching: SELECT * beside other columns and expressions, the BAR_CHART function, FETCH FIRST n ROWS ONLY together with FOR UPDATE SKIP LOCKED, and the time-window table functions TUMBLE, HOP, CUMULATE and SESSIONS. It also added simplified SQL macros, which this lab leaves out.

    Can I use SELECT * with other columns in Oracle?

    From release 23.26.4, yes: SELECT sal * 12 AS annual_sal, * FROM emp works, and each item keeps the place you give it. Before that you needed a table prefix, as in SELECT e.*, sal * 12 FROM emp e, which still works.

    What does BAR_CHART do in Oracle?

    BAR_CHART(value, maximum, minimum, width, symbol) turns a number into a bar of characters in the query result. Only the value is required; the defaults are a range of 0 to 100 and a width of 10. In a UTF-8 database the default symbol draws solid block characters, with part blocks for fractions. If the maximum is below the minimum it returns NULL.

    How do I use FOR UPDATE SKIP LOCKED with FETCH FIRST in Oracle?

    Write the row limit, then the lock: SELECT order_id FROM orders WHERE status = ’NEW’ ORDER BY order_id FETCH FIRST 5 ROWS ONLY FOR UPDATE SKIP LOCKED. Rows locked by other sessions are skipped and do not count toward the 5. The limit must be a row count with ONLY: PERCENT and WITH TIES give ORA-01786.

    What is the difference between TUMBLE, HOP, CUMULATE and SESSIONS?

    TUMBLE makes fixed windows side by side. HOP makes fixed windows that start every slide interval, so they overlap. CUMULATE makes windows that start together and grow by a step up to a maximum size. SESSIONS starts a new window whenever the gap between rows reaches the interval you give.

    Why does my HOP or CUMULATE window start before my first row?

    Window boundaries are fixed points of the clock, not your first row. In my lab, with orders from 09:00, the first 1-hour HOP window ran from 08:30 and the 2-hour CUMULATE windows started at 08:00, 10:00 and 12:00.

    Do I need a paid Oracle database to try these features?

    No. Oracle AI Database 26ai Free, release 23.26.4 or later, has all four. I ran this lab on it with the SCOTT sample schema in the FREEPDB1 pluggable database.

    Are these features in the 1Z0-171 SQL exam?

    Oracle has not said, and an exam usually trails the newest release updates. We teach them because you will meet them at work; for the exam, the course follows Oracle’s published 1Z0-171 topics.

    Saurabh Joshi, Oracle SQL faculty and CTO of Unisoft Technologies

    Saurabh Joshi

    Oracle SQL faculty and CTO, Unisoft Technologies, Nagpur

    I have taught at Unisoft since 17 May 2010: Oracle SQL and PL/SQL, Advanced Excel and data analytics. Every new Oracle release update goes into my syllabus the month it ships, and our lab now runs 23.26.4.

    Certified, and on Credly

    • Oracle Database SQL Certified Associate
    • Oracle Database 12c R2 Administrator Certified Associate
    • Oracle Database 10g Administrator Certified Professional
    • Microsoft Excel Expert (MO-211)
    • Microsoft Excel Associate (MO-210)

    This lab is part of my Oracle SQL course, where every chapter runs like this: on a real Oracle database, on the classroom screen, with the mistakes left in.

    Book a free demo class

    Learn SQL in this classroom

    The Oracle SQL course runs for 90 classes of 2 hours: about 3 months on the fast track, or 6 months at the regular pace. In our classroom in Dharampeth, live online, or one-on-one, on Oracle AI Database 26ai, and mapped to Oracle’s SQL certification.

    1. Tell us what you have studied and what you want SQL for.
    2. We suggest where to begin, and tell you the next batch and the fee.
    3. You come to a free demo class and meet your trainer before you decide.

    Visit us in Dharampeth

    Unisoft Technologies, 2nd Floor, Prananand Building, West High Court Road, above Anand Bhandar, opposite Dress Code, Dharampeth, Nagpur 440010

    Get directions

    We use your details only to contact you about this course. Privacy policy

    Sources

    1. Release Update 23.26.4: Oracle AI Database New Features, 26ai.
    2. SELECT (the select list, and the row_limiting_clause with FOR UPDATE), BAR_CHART and Streaming Windowing Table Functions: Oracle AI Database SQL Language Reference, 26ai.
    3. Oracle error help: ORA-00054, ORA-01786.
    4. My lab run: Oracle AI Database 26ai Free 23.26.4.0.0, SCOTT in FREEPDB1, 30 November 2026.

    Published 30 November 2026. If a later release update changes any of this, I will update the page.