If you’re trying to back up the transaction logs in a SQL Server or SQL Edge database, but you get an error that states BACKUP LOG cannot be performed because there is no current database backup, you’ll need to perform at least one full backup of the database before you attempt to back up the transaction logs.
Continue readingTag: how to
2 Ways to Get the Size of a Database in PostgreSQL
Below are two ways to return the size of a specific database in PostgreSQL.
Continue readingSubtract Microseconds from a Datetime Value in MariaDB
Here are some options for subtracting one or more microseconds from a datetime expression in MariaDB.
Continue readingHow to Format Negative Numbers with Angle Brackets in Oracle
When using the TO_CHAR()
function to format a number in Oracle Database, you can use the PR
format element to return negative values inside angle brackets (<>
).
3 Ways to Format a Number as a Percentage in PostgreSQL
We have several options if we want to display numbers with a percentage sign in PostgreSQL.
We can use the TO_CHAR()
function to format the number along with the percentage sign. Or we can simply concatenate the number with the percentage sign, either with the CONCAT()
function or with the concatenation operator.
Add a Percent Sign to a Number in MariaDB
Below is a quick example of formatting a number as a percentage in MariaDB.
Continue readingAdd Leading Zeros in SQL
Below are examples of adding a leading zero to a number in SQL, using various DBMSs.
Continue readingFormat a Number as a Percentage in Oracle
Even though Oracle Database has a TO_CHAR(number)
function that allows us to format numbers, it doesn’t provide a format element for the percentage sign.
Therefore, if we want to format a number as a percentage in Oracle Database, we need to concatenate the percentage sign and the number.
Continue readingFormat a Number as a Percentage in MySQL
In MySQL, we can format a number as a percentage by concatenating the number with the percent sign.
The CONCAT()
function concatenates its arguments. We can pass the number as the first argument, and the percent sign as the second.
2 Ways to Add a Percent Sign to a Number in SQLite
Here are two ways to format a number as a percentage in SQLite.
Continue reading