Overview
Here are comparisons used in the Advanced Search Tool and their corresponding operators/values in SQL:
Comparison | Description | Example Term | Example Result | Operator/Value |
---|---|---|---|---|
Exact Match | Returns ony the exact search term | John | John (but not Johnny or Jonathan) | = 'John' |
Begins With | Looks at the beginning of the text field | Jo | John, Johnny, Jonathan, Joanna | LIKE 'Jo%' |
Ends With | Looks at the end of the text field | com | .com email addresses but not comcast@sbcglobal.net | Like '%com' |
Contains | Looks anywhere in the field to find a match | Group | Small Group, Group Life, Red Group, Group | LIKE '%Group%' |
IN | Looks in a supplied list for exact matches | Member, Attendee | Member, Attendee | IN ('Member", Attendee') |
BETWEEN | Looks in a range between two values (inclusive) | J to K | Jansen, Johnson, Jylon (but not Kane, because it's after K alphabetically) | BETWEEN 'J' and 'K' |
NULL | Looks for empty fields | Will return records where the field is empty. | IS NULL | |
NOT NULL | Look for fields with values | IS NOT NULL | ||
Not Equal | Looks for anything but exact match | John | Jonnny, Jonathan, Jerry | <> 'John' |
Comparison | Description | Example Term | Example Result | Operator/Value |
---|---|---|---|---|
= | Equals | 4 | 4 | = 4 |
> | Greater Than | 4 | 5, 6, 7, (and up) | > 4 |
< | Less Than | 4 | 0,1,2,3 (and negative values if the field supports them) | < 4 |
> = | Greater Than or Equal To | 4 | 4,5,6, (and up) | > = 4 |
< = | Less Than or Equal To | 4 | 0,1,2,3,4 (and negative values if the field supports them) | < = 4 |
< > | Not Equal To | 4 | 0,1,2,3,5 | <> 4 |
IN | Looks in a supplied list for exact matches. Supports the NOT keyword as in "NOT IN." | 1,3,5 | 1,3,5 | IN (1,3,5) |
BETWEEN | Looks in a range between two values (inclusive). Supports the NOT keyword as in "NOT BETWEEN" | 4 to 6 | 4,5,6 | BETWEEN 4 and 6 |
NULL | Looks for empty fields. Supports the NOT keyword as in "IS NOT NULL" | Will return records where the field is empty. | IS NULL |