w3resource
SQL exercises

SQL: Using where clause with not like operator and escape character

SQL Wildcard & Special Operator : Exercise-15 with Solution

Write a SQL statement to find those rows from the table testtable which does not contain the escape character ( / ) in its column 'col1'.

Sample table: testtable


Sample Solution :

SELECT *
FROM testtable
WHERE col1 NOT LIKE '%//%' ESCAPE '/';

Output of the Query:

col1
A001_DJ-402-2014-2015
A002_DJ-401-2014-2015

Explanation :

Syntax of using where clause with not like operator and escape character

Pictorial presentation :

Exercise: Using where clause with not like operator and escape character

Query Visualization:

Duration:

Query visualization of Using where clause with not like operator and escape character - Duration

Rows:

Query visualization of Using where clause with not like operator and escape character - Rows

Cost:

Query visualization of Using where clause with not like operator and escape character - Cost

 

Practice Online


Contribute your code and comments through Disqus.

Previous: Write a SQL statement to find those rows from the table testtable which contain the escape character ( / ) in its column 'col1'.
Next: Write a SQL statement to find those rows from the table testtable which contain the string ( _/ ) in its column 'col1'.

What is the difficulty level of this exercise?



New Content: Composer: Dependency manager for PHP, R Programming