~/devreads

#common table expressions

8 posts

22 Aug 2017

lukaseder 1 min read

SQL is a really cool language. I can write really complex business logic with this logic programming language. I was again thrilled about SQL recently, at a customer site: Writing some nifty SQL queries for a customer. Wondering why anyone would even consider using a 3GL for any business logic at all?? — Lukas Eder … Continue reading Finding all…

sqlcommon table expressionspalindromesrecursive sql

24 Jul 2017

lukaseder 1 min read

In recent months, there had been some really exciting news from the MySQL team: (Recursive) Common Table Expressions in MySQL Introducing Window Functions These two SQL standard language features are among the most powerful SQL features that are available from most other databases. I frequently include them in conference talks about SQL (see my article … Continue reading jOOQ 3.10…

jooq-developmentsqlcommon table expressionshierarchical sqljooq

25 Apr 2016

lukaseder 1 min read

Listicles like these do work – not only do they attract attention, if the content is also valuable (and in this case it is, trust me), the article format can be extremely entertaining. This article will bring you 10 SQL tricks that many of you might not have thought were possible. The article is a … Continue reading 10 SQL…

sqlanalytic functionsanalyticscommon table expressionsmatch recognize clause

24 Mar 2016

lukaseder 1 min read

This Stack Overflow question has yet again nerd-sniped me [finding the] maximum element in the array that would result from performing all M operations Here’s the question by John that was looking for a Java solution: With an array of N elements which are initialized to 0. we are given a sequence of M operations … Continue reading Time for…

sqlcommon table expressionsprefix sumwindow functions

26 Oct 2015

lukaseder 1 min read

I’ve stumbled upon this very interesting question on Stack Overflow, recently. Its title is: [How to] compare a number with sum of subset of numbers In this article, we’ll compare the user’s imperative approach to the extremely elegant (Oracle) SQL approach. We’ll be making use of any combination of these awesome SQL features: Window functions … Continue reading How to…

sqlcommon table expressionscross applydense rankfirst

2 Jun 2015

lukaseder 1 min read

You probably know about “ordinary views” already, but I’m sure you’ll find one or two things in this article that you haven’t thought about in this way yet… What exactly are SQL views? Views in SQL are a means of treating complex queries in the same way as “ordinary” tables. In fact, SQL is all … Continue reading What Exactly…

sqlcommon table expressionsderived tablesoptimiserrdbms

18 Aug 2014

lukaseder 1 min read

Oracle SYNONYMs are a great feature. You can implement all sorts of backwards-compatibility tweaks simply by creating SYNONYMs in your database. Consider the following schema: Now you can query your same old table through three different names, it’ll all result in the same output: The trouble is, when you see my_table_bak in code (or some … Continue reading All You…

sqlcommon table expressionshierarchical sqloraclerecursive sql

26 May 2014

lukaseder 1 min read

(Sorry for that click-bait heading. Couldn’t resist ;-) ) We’re on a mission. To teach you SQL. But mostly, we want to teach you how to appreciate SQL. You’ll love it! Getting SQL right or wrong shouldn’t be about that You’re-Doing-It-Wrong™ attitude that can be encountered often when evangelists promote their object of evangelism. Getting … Continue reading Yet Another…

javasqlboolean typecommon table expressionsconstraints