>

SQL


Using SQL to get the number of occurrences of a character in a string in SQL Server

This SQL Snippet can be used to get the count of a single character, or an entire phrase, in a string.  We have a seperate post for doing the same thing in Oracle. Assume you have the string “a,b,c,d,e” and you want the count of commas (“,”) contained in that string.  Just use the SQL below:…


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…


SQL Azure

The Windows Azure platform offers the optional SQL Azure database as a supplement to the rudimentary data storage provided by the Storage AppFabric.  Unlike the storage appFabric, SQL Azure is a cloud-based relational database that is an extension of Microsoft SQL Server.  This multi-tenant, highly scalable database runs in the Azure cloud.  This cloud-based database supports the…