Fabricating Data Sets You often need to fabricate a data set when it comes to creating a report showing daily results for each day in a certain range, regardless of whether there was an activity on a particular day or not. That being said, you need to build a query that will produce a row for each day within a...
Author: Yuli Vasiliev
Multi-level Aggregation
Multi-level Aggregation You perform a multi-level aggregation when you need to combine data from different levels of aggregation. In this article, you’ll look at an example of how you might perform a multi-level aggregation within a single SQL query that contains subqueries, sending the aggregated data from the inner to the higher level of the query and combining the aggregated...
Combining Aggregated Data With Inline Views
Combining Aggregated Data With Inline Views If your responsibility is to compose the queries producing aggregated data, you no doubt know that it’s not always possible to get the job done with a simple query – a one that contains subqueries, such as inline views, may be required. This article illustrates how you might use inline views as a way...
How To Not Include a Column From The SELECT List In The GROUP BY Clause
How To Not Include a Column From The SELECT List In The GROUP BY Clause Sometimes you don’t need to group by each column or expression included in the SELECT list of the query. For example, you may want to not include ROWNUM in the GROUP BY clause in spite of the fact that it appears in the SELECT list....
count and NULLs
count and NULLs The Oracle SQL count function can be used to count either rows or fields in SQL queries. This article provides some examples on using the count function in both simple queries and in those that use aggregate functions and group a result set. Before going any further, you need to prepare your working environment. In particular, you...
Using Non-Equi Joins
Using Non-Equi Joins Non-equi joins are those ones where the join condition uses an inequality comparison. This can be useful when defining self joins – ones defined on the same table. Suppose you have a table whose rows contain information about football teams. You need to make up a schedule for a series of games where each team is to...
Setting Up Oracle Database 12c on Oracle VM VirtualBox
Setting Up Oracle Database 12c on Oracle VM VirtualBox This article explains how to get started quickly with Oracle Database 12c installed in a virtual machine running on Oracle VM VirtualBox. In particular, you will look at how to install a VM, taking advantage of the pre-built Oracle Linux 6 Admin VM. Then, you’ll walk through the process of installing...
Exposing Oracle Database Data Via Oracle XML DB HTTP Server
Exposing Oracle Database Data Via Oracle XML DB HTTP Server By Yuli Vasiliev If you have ever used Oracle XQuery, you already know that this tool is really good when it comes to accessing external sources and bringing data extracted from them into your Oracle database. Sometimes, however, you may need to expose data stored in your Oracle database to...
Querying Relational Data With XQuery
Querying Relational Data With XQuery By Yuli Vasiliev This article illustrates how you might query relational data with Oracle XQuery. It also shows how you might join relational data with XML in a single SQL query, thus demonstrating the Oracle Database’s ability to work with and combine together different format data. In the following example, you query the DEPARTMENTS and...
Generating Relational Data From XML With XMLTable
Generating Relational Data From XML With XMLTable By Yuli Vasiliev Starting with 10g Release 2, Oracle Database offers a full-featured, native XQuery engine integrated with the database that can be used to accomplish various tasks involved in developing XML-enabled applications. With the help of Oracle XQuery you can construct XML data using SQL/XML functions XMLQuery and XMLTable, which provide a...