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

INSTR() Equivalent in SQL Server

Many RDBMSs have an INSTR() function that enables us to find a substring within a string. Some (such as MySQL and MariaDB) also have a LOCATE() function and a POSITION() function (also supported by PostgreSQL), that do a similar thing.

SQL Server doesn’t have an INSTR() function. Nor does it have a LOCATE() or POSITION() function. But it does have the CHARINDEX() function that does the same thing.

SQL Server also has the PATINDEX() function, which does a similar job to CHARINDEX().

Read more