Do you want BuboFlash to help you learning these things? Or do you want to add or correct something? Click here to log in or create user.



Question
This SQL Server LIKE condition example would return all employees whose first_name is 5 characters long, where the first two characters is 'Sm' and the last two characters is 'th', and the third character is neither 'i' or 'y'. So in this case, it would match on values such as 'Smath', 'Smeth', 'Smoth', etc. But it would not match on either 'Smith' or 'Smyth'.
Answer
SELECT *
FROM employees
WHERE first_name LIKE 'Sm[^iy]th';

This SQL Server LIKE condition example would return all employees whose first_name is 5 characters long, where the first two characters is 'Sm' and the last two characters is 'th', and the third character is neither 'i' or 'y'. So in this case, it would match on values such as 'Smath', 'Smeth', 'Smoth', etc. But it would not match on either 'Smith' or 'Smyth'.


Question
This SQL Server LIKE condition example would return all employees whose first_name is 5 characters long, where the first two characters is 'Sm' and the last two characters is 'th', and the third character is neither 'i' or 'y'. So in this case, it would match on values such as 'Smath', 'Smeth', 'Smoth', etc. But it would not match on either 'Smith' or 'Smyth'.
Answer
?

Question
This SQL Server LIKE condition example would return all employees whose first_name is 5 characters long, where the first two characters is 'Sm' and the last two characters is 'th', and the third character is neither 'i' or 'y'. So in this case, it would match on values such as 'Smath', 'Smeth', 'Smoth', etc. But it would not match on either 'Smith' or 'Smyth'.
Answer
SELECT *
FROM employees
WHERE first_name LIKE 'Sm[^iy]th';

This SQL Server LIKE condition example would return all employees whose first_name is 5 characters long, where the first two characters is 'Sm' and the last two characters is 'th', and the third character is neither 'i' or 'y'. So in this case, it would match on values such as 'Smath', 'Smeth', 'Smoth', etc. But it would not match on either 'Smith' or 'Smyth'.

If you want to change selection, open document below and click on "Move attachment"

SQL Server: LIKE Condition
square brackets with ^ wildcard) works in the SQL Server LIKE condition. Remember that what is contained within the square brackets are characters that you do NOT want to match on. For example: <span>SELECT * FROM employees WHERE first_name LIKE 'Sm[^iy]th'; This SQL Server LIKE condition example would return all employees whose first_name is 5 characters long, where the first two characters is 'Sm' and the last two characters is 'th', and the third character is neither 'i' or 'y'. So in this case, it would match on values such as 'Smath', 'Smeth', 'Smoth', etc. But it would not match on either 'Smith' or 'Smyth'. Example - Using NOT Operator Next, let's look at how you would use the SQL Server NOT Operator with wildcards. Let's use the % wilcard with the NOT Operator. You could also use the SQL

Summary

statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill

Details

No repetitions


Discussion

Do you want to join discussion? Click here to log in or create user.