By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
select @@version;
(No column name) |
---|
Microsoft SQL Server 2019 (RTM-CU6) (KB4563110) - 15.0.4053.23 (X64) Jul 25 2020 11:26:55 Copyright (C) 2019 Microsoft Corporation Express Edition (64-bit) on Windows Server 2019 Standard 10.0 <X64> (Build 17763: ) (Hypervisor) |
create table station(
city nvarchar(256) not null
)
insert into station
values ('orlando'), ('atlanta'), ('indianapolis'), ('san fransisco'), ('montreal')
5 rows affected
select city from station
city |
---|
orlando |
atlanta |
indianapolis |
san fransisco |
montreal |
select city from station where city like '[aeiou]%[aeiou]'
city |
---|
orlando |
atlanta |
select city from station where city not like '[aeiou]%[aeiou]'
city |
---|
indianapolis |
san fransisco |
montreal |
Select city
from station
where city like '[^aeiou]%[^aeiou]'
city |
---|
montreal |