Enclose Strings in Single Quotes in SQLite Query Results

When working with the SQLite command line shell, you have the option of having your query results formatted as string literals.

You can do this by switching to “quote” mode. When you do this, strings are enclosed in single-quotes and internal single-quotes are escaped by doubling. Also, blobs are displayed in hexadecimal blob literal notation, numbers are displayed as ASCII text, and NULL values are shown as “NULL”.

If you need to format your results with double quotes, consider using csv mode.

Continue reading

How the MAKE_SET() Function Works in MySQL

In MySQL, the MAKE_SET() function returns a set value (a string containing substrings separated by , characters) consisting of the characters specified as arguments when you call the function.

When you call the function, you specify any number of strings (separated by a comma), as well as one or more bit values that determine which strings to return in the set value.

Continue reading