S13 LIKE selectors with WILDCARDS

S13 LIKE selectors with WILDCARDS

The following SQL statement selects all customers with a CustomerName starting with “s”:

SELECT * FROM Customers
WHERE CustomerName LIKE ‘s%’;

The following SQL statement selects all customers with a CustomerName ending with “h”:

SELECT * FROM Customers
WHERE CustomerName LIKE ‘%h’;

The following SQL statement selects all customers with a CustomerName that have “ra” in any position:

SELECT * FROM Customers
WHERE CustomerName LIKE ‘%ra%’;

The following SQL statement selects all customers with a CustomerName that have “a” in the second position:

SELECT * FROM Customers
WHERE CustomerName LIKE ‘_a%’;

The following SQL statement selects all customers with a CustomerName that starts with “a” and are at least 3 characters in length:

SELECT * FROM Customers
WHERE CustomerName LIKE ‘a__%’;

The following SQL statement selects all customers with a ContactName that starts with “s” and ends with “h”:

SELECT * FROM Customers
WHERE ContactName LIKE ‘a%o’;

The following SQL statement selects all customers with a CustomerName that does NOT start with “a”:

SELECT * FROM Customers
WHERE CustomerName NOT LIKE ‘a%’;

Take Your Free Live Demo Class Now

Enter Your DETAILS BELOW

To Get Complete Information or We Will Call You

We Will Send You the Course Fees Details In Below Number

Enter Your DETAILS BELOW

We Will Call Back You Shortly

Enter Your DETAILS BELOW

We Will Call Back You Shortly

Enter Your DETAILS BELOW

Enter Your DETAILS BELOW TO take

free demo class