Like with escape : LIKE « Select Query « SQL Server / T-SQL






Like with escape


1> CREATE TABLE project   (project_no   CHAR(4) NOT NULL,
2>                         project_name CHAR(15) NOT NULL,
3>                         budget FLOAT NULL)
4> GO
1> insert into project values ('p1', 'Search Engine',        120000.00)
2> insert into project values ('p2', 'Programming',          95000.00)
3> insert into project values ('p3', 'SQL',                  186500.00)
4> GO

(1 rows affected)

(1 rows affected)

(1 rows affected)
1>
2> SELECT project_no, project_name
3>        FROM project
4>        WHERE project_name LIKE '%!_%' ESCAPE '!'
5> GO
project_no project_name
---------- ---------------

(0 rows affected)
1> drop table project
2> GO
1>
           
       








Related examples in the same category

1.Wildcard characters recognized by SQL Server for use in regular expressions.
2.LIKE operator with NOT
3.Use like to filter strings
4.LIKE '%[k-l]%'
5.LIKE 'A_____'
6.LIKE '^A%' (begining with A)
7.Like with variable
8.Like statement with two variables
9.Like with variable and wild card character