Oracle


Select Sequential Numbers with Oracle SQL

Oracle provides the connect by clause that can be used to specify a relationship between parent rows and child rows.  This is used as part of the hierarchical query clause.  In general usage, the connect by clause uses the prior keyword to define the relationship.  When using the connect by clause, the level pseudocolumn is…


Using SQL to get the number of occurances of a character in a string in Oracle

This SQL Snippet can be used to get the count of a single character in a string using Oracle. We have a seperate post for doing the same thing in SQL Server. Assume you have the string a,b,c,d,e and you want the count of commas.  Just use the SQL below. Select length('a,b,c,d,e')-length(replace('a,b,c,d,e',',')) from dual; Running this query returns…


Convert a CSV String into Rows using OracleSQL

The is the Oracle version of an SQL Solution which can transform a string of CSV values into rows, with one row per value.  The SQL snippet uses a delimited string, and will convert this string to rows using the delimiter.  Assume you have a Comma Seperated Value (CSV) string such as: a,b,c,d and need to convert it to…