Below is a list of T-SQL comparison operators that you can use in SQL Server.
Continue readingTag: operators
What is a Comparison Operator?
Comparison operators are an important part of most programming languages.
Comparison operators are used to compare two expressions. The result is either true
or false
. It could also be unknown. This could also be represented by either 1
, 0
, or NULL
, depending on the language. These are typically known as “Boolean expressions”.
When used with databases, comparison operators can be used inside your SQL queries to filter data to a certain criteria.
Continue readingHow to Test for Overlapping Dates in PostgreSQL
In PostgreSQL, you can use the OVERLAPS
operator to test for overlapping time periods.
The function returns true when two time periods (defined by their endpoints) overlap, and false when they do not overlap.
Continue reading2 Ways to Insert a New Line into a String in SQLite
This article presents two ways to insert a new line character into a string in SQLite.
This means you can have some text on one line, more text on another line, etc, rather than it being one long line.
Continue readingHow to Concatenate Strings in SQLite
SQLite doesn’t have a concat()
function like many other database management systems, such as SQL Server’s concat()
and MySQL’s concat()
.
However, that doesn’t mean you can’t concatenate two strings in SQLite.
SQLite has a concatenation operator (||
) that you can use to concatenate two strings.
How to Make SQLite’s LIKE Operator Case-Sensitive
By default, the SQLite LIKE
operator is case-insensitive for ASCII characters. This means it will match uppercase and lowercase characters, regardless of which case you use in your pattern.
However, there is a technique you can use to make it case-sensitive.
Continue readingHow the LIKE Operator Works in SQLite
In SQLite, you can use the LIKE
operator in your queries to do a pattern matching comparison.
For example, you can add it to your WHERE
clause in order to return only rows that match a given pattern.
However, adding it to the WHERE
clause isn’t the only way you can use the LIKE
operator. You can also use it to return a boolean value.
3 Ways to Detect if a String Matches a Regular Expression in MySQL
MySQL has a number of functions and operators that allow us to perform operations using regular expressions (regex). This article presents two operators and one function that enable us to find out if a string matches a regular expression specified by a given pattern.
These regex functions and operators are:
These are all basically equivalent, as the operators (the second two) are both synonyms of the function (the first one). In any case, you can see examples of all three in action below.
How the MATCH() Function Works in MySQL
In MySQL, the MATCH()
function performs a full-text search. It accepts a comma separated list of table columns to be searched.
The table/s must have a FULLTEXT
index before you can do a full-text search against them (although boolean queries against a MyISAM
search index can work — albeit slowly — even without a FULLTEXT
index).
You can create a FULLTEXT
index when creating the table (using the CREATE TABLE
statement), or you can use the ALTER TABLE
statement or the CREATE INDEX
statement if the table already exists.
By default, the search is case-insensitive. To perform a case-sensitive search, use a case-sensitive or binary collation for the indexed columns.
MySQL String Functions (Full List)
MySQL includes a bunch of functions and operators that can help us when working with data.
The following is a list of string functions and operators available in MySQL. Click on each function or operator name to see an explanation of the function, its syntax, and examples.