In this little tutorial, I will show you how you can transpose columns into rows in Oracle, using SQL. This post is a follow-up of a post where I showed how to transpose rows into columns. Read More »
Category Archives: Tutorials
How To Generate Date Range In Oracle SQL?
Have you ever wanted to generate a list of dates using Oracle SQL? In this little tutorial I will show you three different ways you can do this with a simple SQL query. I will also show a practical use of it. Read More »
Introduction To Aggregate Functions In Oracle
If you are new to SQL, you still might have heard about aggregate functions. These are functions that can be used inside a SELECT query. In this tutorial we are going to look a bit on what it is, and how it can be used. Read More »
How To Work With Downline Hierarchies In Oracle
Hieararchies or trees in Oracle using CONNECT BY is actually pretty fun to work with. Lately I have been a real “tre-hugger”, since I have worked a lot with different tree structures, and downlines. I thought I wanted to share some of my latest experiences. In this tutorial we are going to look a little bit on downline hierarchies in ... Read More »
How To Rank Records in Oracle SQL
A long time ago I put together a tutorial (How To Use Oracle Analytic Functions in Oracle SQL) on how to use some of the more common Oracle Analytic Functions. In this tutorial I am going to discuss how to rank records in Oracle using the RANK() and the DENSE_RANK() analytic functions. I chose to put this in a separate post, since it ... Read More »
Quick Tip: How To Pick Random Customers In Oracle
At my work I am responsible for generating data for 90% of our contests. Once in a while there are requests where they want to pick out. i.e. ten random people. This quick tip is showing you one way how to pick random customers in Oracle using SQL. Read More »
Quick Tip: Do Not Use TRUNC To Filter on a Date and Time Field
Doing a TRUNC on a date might seem as a perfect solution if you want to query records having a column with both a date and a time. But, as you will see in this little Quick Tip, it is not always that smart. Read More »
Three Ways To Transpose Rows Into Columns in Oracle SQL
Have you ever been in a situation where you as a developer knows that your data is stored in your table rows, but your customer don’t care…wanting to present the data as columns? In this tutorial I will discuss three different variants on how to transpose table rows into columns. By using SUM + DECODE, the new Oracle 11g PIVOT ... Read More »
How To Calculate Difference Between Dates in Oracle SQL
If you have worked with SQL for a while – you have most likely had a time where you wanted to show in a query the difference between two dates. It can be for example to calculate how long a person has been hired in your company, how old a person is today, etc. In this tutorial we are going ... Read More »
How long will my SQL query run
Have you ever started a query in your favourite Oracle SQL tool and it is just runnin’, and runnin’, and runnin’…? And, you are wondering if the query will let you eat lunch before it finishes…? Well, here is a way you might be able to find out how long your SQL query will take. Read More »
OracleTuts Oracle Training, Tutorials, and Videos from Beginner to Advanced
