Find a String within a String in SQL

Most of the major DBMSs provide us with a way to find a string within a string using SQL. By this, I mean use a SQL query to find the position of a substring within a string.

There are several SQL functions that allow us to do this, including INSTR(), LOCATE(), POSITION(), and CHARINDEX(). The function you use will depend on your DBMS, and possibly whether or not you need to specify a starting position.

Read more

RR vs YY in Oracle

When formatting dates in Oracle Database, we have the option of using RR and YY to return a two digit year.

These two format elements are similar. The difference is in how they interpret two digits years.

We also have the option of using RRRR and YYYY when returning four digit years.

Read more