SQL

Access data from previous record

How to mix values from the current rows with values from previous or preceding rows.

Using WITH to avoid duplicate code

How to avoid duplicate sub queries with using the SQL-99 clause WITH.

Creating a Dummy Table for Tests

Every needed a table with some data to run your tests? Check this article for a simple query to create a table with random text and dates.

Using Flashback to recover lost data

You sure have a backup when running an Oracle database but sometimes it takes a while to restore a single table or even a single row. Oracle comes with a handy feature called "Flashback" which allows you to run a query on a table state from the past.

What Oracle Functions are there

Ever wondered what Oracle function you can use? There's a data dictionary telling you about every available function including some additional information.

Get a list of all available Tables in your Oracle database

Having a list of tables in a database can help you to get a picture of what's there. Here's how you can do that.

Aggregate multiple rows into one as a comma-delimted list

Ever wanted to group a number of rows into a single row as a list? This recipe shows you how to do that.

Limit number of rows in a sorted query

Have you ever tried to limit the number of rows in combination with an order by and didn't get the expected result? Here's why and of course the correct way!

Working with Arrays - VARRAY

In some rare cases you won't want to normalize a table but simply add a list of values in a single cell. This is what VARRAY types are good for.

Create a table out of nothing

sql table out of nothing