Although we've looked at several examples of using SELECT
statements to manipulate strings of text, we can just as easily use SQL to complete arithmetic operations. As with many programming languages, we can make use of arithmetic operators to accomplish this.
Let's say, for a moment, you did not want to display data from a table, but rather a fixed literal statement such as "I Love Companylink". We need to introduce another set of syntactical operators, the single quotes ('
), in order to do this. In SQL, when any word or phrase is enclosed within single quotes, it becomes expressed as a string literal. However, how would we display our literal statement using SQL? The only statement at our disposal, so far, is the SELECT
statement. We could attempt a statement as follows:
Select 'I Love Companylink';
However, such a statement is syntactically incorrect, since every SELECT
statement requires a FROM
clause; thus...