Skip to content

Instantly share code, notes, and snippets.

@LitKnd
Created May 28, 2018 20:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LitKnd/7227dbd122e1141c46e0864d400879e6 to your computer and use it in GitHub Desktop.
Save LitKnd/7227dbd122e1141c46e0864d400879e6 to your computer and use it in GitHub Desktop.
/*****************************************************************************
Copyright (c) 2018 SQL Workbooks LLC
Terms of Use: https://sqlworkbooks.com/terms-of-service/
Contact: help@sqlworkbooks.com
*****************************************************************************/
--How many rows will this return?
SELECT *
FROM
(VALUES
('corgis'),
('have'),
('100%'),
('more'),
('sploot!')
) as t(col1)
WHERE
col1 like '%';
GO
--How many rows will this return?
SELECT *
FROM
(VALUES
('corgis'),
('have'),
('100%'),
('more'),
('sploot!')
) as t(col1)
WHERE
col1 like '%' ESCAPE '!';
GO
--How many rows will this return?
SELECT *
FROM
(VALUES
('corgis'),
('have'),
('100%'),
('more'),
('sploot!')
) as t(col1)
WHERE
col1 like '%!%' ESCAPE '!';
GO
--How many rows will this return?
SELECT *
FROM
(VALUES
('corgis'),
('have'),
('100%'),
('more'),
('sploot!')
) as t(col1)
WHERE
col1 like '!%' ESCAPE '!';
GO
--How many rows will this return?
SELECT *
FROM
(VALUES
('corgis'),
('have'),
('100%'),
('more'),
('sploot!')
) as t(col1)
WHERE
col1 like '100!%' ESCAPE '!';
GO
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment