In SQL, single quotation marks enclose literal character values, such as a title name, when they appear in a filter. Without them, a string value causes a syntax error. section 5.1.2
Filtering for a title
SELECT Advance FROM title WHERE TitleName = 'Anne of Fact Tables'; The value inside the quotes must match the stored text exactly. An omitted letter, extra space, tab, or carriage return can produce no results. section 5.1.2
Use single quotation marks carefully:
- Use the straight single quote on the same keyboard key as the double quote; typographic quotes copied from documents can cause syntax errors. section 5.1.2
- Enclose date and time values in single quotes, commonly using the year-month-day format followed by hours, minutes, and seconds. section 5.1.3
- Do not quote numeric values unnecessarily; implicit conversion may reduce query efficiency on larger data sets. section 5.4
A date value
SELECT TitleName, PublicationDate FROM title WHERE PublicationDate = '2020-03-14'; A date without a time is treated as midnight, or 00:00:00. Include time precision when the stored value contains meaningful hours, minutes, or seconds. section 5.1.3
