@pauldamian.bsky.social

Hi I'm pl/sql developer

Do your outer join queries produce more rows than expected? In this blog post, I show a strange result when using filter predicates in the join clause. dbLinter can help you sort your join and filter criteria and spot issues like this. www.salvis.com/blog/2025/07...

Outer Joining With ANSI SQL-89 and SQL-92

Introduction I recently implemented a quick fix for the rule G-3130 to transform queries to ANSI SQL-92 syntax. One of the challenges was to handle Oracle’s outer-join syntax (+). In ANSI SQL-89, join...

salvis.com

Oracle Database 21c enhanced analytic functions to support GROUPS, EXCLUDE, & the WINDOW clause: fn ( ... ) OVER ( <w> GROUPS ... EXCLUDE ... ) ... WINDOW <w> AS ( ... ) GROUPS => rows with the same sort key are in the same group EXCLUDE => omit the current or adjacent rows

Enhanced Analytic Functions (ISO SQL Standard)
Window functions now support GROUPS & EXCLUDE in the SQL standard window frame clause
SQL statements now support the window_clause from the SQL standard
Example using a named window with GROUPS and EXCLUDE frames.

Group ordered rows into batches up to a given size (bin packing) in Oracle #SQL with SELECT ... FROM ... MATCH_RECGONIZE ( ORDER BY ... MEASURES ... PATTERN ( total+ ) DEFINE total AS SUM ( ... ) <= ... ) e.g. to group sales by date into batches with value <= X

You can diff two tables to find the rows only in one with: SELECT * FROM ( SELECT 't1' t1, t1.* FROM t1) t1 NATURAL FULL JOIN ( SELECT 't2' t2, t2.* FROM t2 ) t2 WHERE t1 IS NULL OR t2 IS NULL For this to work the columns must Have the same names in each table Contain no NULLs

Turn rows into columns in Oracle #SQL with PIVOT ( fn FOR col IN ( 'v1', 'v2', ... ) ) This adds a column for each value in the IN list with the fn result You can have many fns but must alias each: PIVOT ( fn1 a1, fn2 a2 ... ) Any table columns not in the PIVOT clause form an implicit group by

It’s horrifying that it’s come to this, but as someone with a deep affinity for Europe I feel moved seeing that continent come together to try to save itself in the absence of any meaningful aid from the totalitarian regime that’s in the midst of taking over the United States through an illegal coup

Bild

When you create an index on a column, the database stores its values and a pointer to the corresponding row This means a value can be listed many times in an index - once for each row Deduplicate entries within a block in Oracle Database with CREATE INDEX ... COMPRESS

Join me next Wednesday (12 Feb) to learn about using PL/SQL to build #database APIs We'll cover Oracle Database 23ai enhancements to help you do this such as: Better loops Extended case expressions JSON integration The automatic SQL transpiler Starts 10am UK time go.oracle.com/LP=146704?el...

Developer Coaching: Build Database APIs with PL/SQL in Oracle Database 23ai

Oracle Database 23ai continues to enhance PL/SQL with better loops, extended case expressions, and better JSON integration. Join this session to learn what’s new to help you build data-drive apps.

go.oracle.com

Merry SQLmas! Wishing you all the best over the festive season Hope you have a fantastic time We'll be back in 2025 with more #SQL tips In the meantime, enjoy this SQLmas tree!