Some DBMSs have an LPAD() and RPAD() function which can be used to pad numbers with leading and trailing zeros.
SQL Server doesn’t have such a function. But that doesn’t prevent us from being able to pad numbers with leading/trailing zeros.
When using SQLcl or SQL*Plus with Oracle Database, you may have noticed feedback at the bottom of your query results that tells you how many rows were selected. For example, 100 rows selected (or however many rows were returned).
If you want to get rid of this, you can use SET FEEDBACK OFF.
You also have the option of setting a row threshold, which allows you to specify how many rows should be returned before feedback is provided.
There are many ways to perform date arithmetic in MariaDB. This includes adding or subtracting a certain number of a given date part from a date or datetime value.
In this article, I present 8 ways to add an hour to a datetime value in MariaDB.
In Azure SQL Edge, you can query the sys.databases catalog view to see the recovery model for each database.
PostgreSQL provides us with the following ways to concatenate strings and numbers:
CONCAT() function, which concatenates its arguments.||), which concatenates its operands.Examples of each below.
If you get an error that reads The statement BACKUP LOG is not allowed while the recovery model is SIMPLE when trying to back up a database in SQL Server or Azure SQL Edge, it’s because you’re trying to back up the transaction logs on a database that uses the simple recovery model.
To fix this, change the recovery model to either full or bulk logging.
In PostgreSQL, RPAD() is a function that enables us to add padding to the right part of a string.
In PostgreSQL, LPAD()is a function that enables us to add padding to the left part of a string.
In SQL Server, the TODATETIMEOFFSET() function was specifically designed to return a datetimeoffset value from a datetime2 value.
Given the fact that the datetime2 data type doesn’t actually support time zone offsets, and datetimeoffset must contain the offset, the TODATETIMEOFFSET() function allows you to specify a time zone offset to use.
This article provides some examples to demonstrate.