SQL Part2- Filtering Rows
本篇為初學者自學第二篇,由於是自學筆記,撰寫角度以筆者本身需求為優先考量。
BETWEEN
IS NULL
IS NOT NULL
DISTINCT
LIKE
Get the names of people whose names have ‘r’ as the second letter. The pattern you need is '_r%'
.
SELECT name
FROM people
WHERE name LIKE ‘_r%’;
NOT LIKE
Get the names of people whose names don’t start with A. The pattern you need is 'A%'
.
SELECT name
FROM people
WHERE name NOT LIKE ‘A%’;