

Regular expression operators is that like() uses wild-card symbols (e.g., The most important syntactic difference between the use of the like() function and The special characters used in regular expressions areĮxplained in detail later in this section. The special characters in this sequence are theĬaret ( ^), and the pipe ( |), while the literalĬharacters are A and T. WHERE clause, and the regular expression sequence itself in Example 5-5 is ^A|^T. The ~ symbol is the regular expression operator, within the An example regular expression booktown=# SELECT first_name, last_name This function is described further in the Section called Functions."Įxample 5-3 illustrates a comparative check on the books table,Īnd returns all titles whose first letter would be sorted before the letter D.Įxample 5-5. If you are unsure of how a character will be sorted, you can use the ascii()įunction to determine the ASCII value of the character. In the following example: booktown=# SELECT letter, This sorting scheme, characters are determined to be higher than one another based on their ASCII value, as demonstrated If the leading characters in two strings are atĪll identical, each character is checked from left to right until two different characters are found for comparison. If one character is considered 'greater than' or 'less than' the other. Referred to by Table 5-1 compares each sequential character in a string, determining Basic Character String OperatorsĪ comparison returning true if string matches comparison identicallyĪ comparison returning true if string does not match comparison identicallyĪ comparison returning true if string should be sorted alphabetically after comparisonĪ comparison returning true if string should be sorted alphabetically after comparison, or if the values are identicalĮach of the string comparison operators returns a Boolean result of either true or false.
