In PostgreSQL, we can use the +
operator to add one or more years to a date.
Category: DBMS
Database Management Systems
SQLite JSON_ARRAY_LENGTH()
In SQLite, the json_array_length()
function returns the number of elements in a given JSON array.
The array is provided as an argument. If the array is embedded within a larger JSON document, we can use an optional second argument to specify the path to the array.
If the value is not an array, the function returns 0
.
Return Only Numeric Values in MySQL
The following MySQL query returns only those rows that have numeric values in a given column.
Continue readingSQLite JSON_GROUP_OBJECT()
The SQLite json_group_object()
function is an aggregate function that returns a JSON object comprised of all name/value pairs in the aggregation.
In other words, it constructs a JSON object from the values provided by its arguments.
Continue readingSQLite JSON_GROUP_ARRAY()
The SQLite json_group_array()
function is an aggregate function that returns a JSON array comprised of all values in the aggregation.
In other words, it constructs an array from the values provided by its argument.
Continue readingSQLite JSON_VALID()
In SQLite, the json_valid()
function checks whether or not its argument is well-formed JSON.
It returns 1
if the argument is well-formed JSON, and 0
if it’s not.
SQLite JSON_ARRAY()
In SQLite, the json_array()
function returns a well-formed JSON array based on its arguments.
The function accepts zero or more arguments, and each argument becomes an element in the resulting array.
Continue readingSQLite JSON_OBJECT()
The SQLite json_object()
function returns a well-formed JSON object based on its arguments.
The function accepts zero or more pairs of arguments and returns a well-formed JSON object based on those arguments.
Continue readingSQLite JSON()
In SQLite, the json()
function converts raw text that looks like JSON into actual JSON.
We pass a JSON string as an argument when we call the function. The json()
function then checks that the argument is a valid JSON string and returns a minified version of that JSON string. If the argument is not a well-formed JSON string, then an error is thrown.
However, the json()
function was not designed to test whether or not a value is valid JSON. To do that, use the json_valid()
function instead.
2 Ways to Delete Duplicate Rows in Oracle
The following options can be used to delete duplicate rows in Oracle Database.
These examples delete duplicate rows but keep one. So if there are three identical rows for example, it deletes two of them and keeps one. This is often referred to as de-duping the table.
Continue reading