In PostgreSQL, the CONCAT_WS() function concatenates two or more strings, placing a separator between each one. The separator is specified by the first argument.
Object-Relational
2 Functions that Get the Day, Month, and Year from a Date in Oracle
Oracle Database has the TO_CHAR(datetime) function that enables us to get various date parts from a datetime value.
There’s also the EXTRACT(datetime) function that extracts a specific datetime unit (e.g. day, month, year, etc).
2 Ways to Format your Query Results in SQLcl (Oracle)
When using SQLcl to run queries against Oracle Database, you can specify the output of the query results using the following two options:
- The
SET SQLFORMATcommand - Add a comment shortcut to your query
How the CONCAT() Function Works in PostgreSQL
In PostgreSQL, the CONCAT() function concatenates the text representations of its arguments.
How to Format Numbers with a Minus/Plus Sign in Oracle
When using the TO_CHAR() function to format a number in Oracle Database, you can use the S format element to return its sign (i.e. a plus sign for positive values, and a minus sign for negative values).
You can also use the MI format element to return negative values with a trailing negative sign, and positive values with a trailing blank.
3 Functions that Get the Day, Month, and Year from a Date in PostgreSQL
PostgreSQL provides us with several ways to get the day, month, and year from a date.
Three functions that immediately come to mind are; DATE_PART(), EXTRACT(), and TO_CHAR().
Export Query Results to an XML File when using SQLcl (Oracle)
When using SQLcl with Oracle Database, you can export your query results to an XML file with the SPOOL command.
2 Ways to Concatenate a String and a Number in Oracle
In Oracle Database, we can concatenate strings and numbers with the CONCAT() function or the pipe concatenation operator (||).
How to Format Numbers in Oracle
In Oracle Database, you can format numbers in many ways.
For example, you can format a number as a currency, with commas and decimal points in the right place. You can specify leading zeros, you can add a fractional part – or remove it, if that’s what’s required.