At one time I was working on database reporting. I found that I spent about 90% of my time typing select into the PL/SQL developer program that I was using.
Select, combining with a where clause, is the most common and the most important statement that we need to master.
String Pattern Matching – LIKE and NOT LIKE
For strings, we can perform pattern matching using operator like (or not like) with wildcard characters.
‘%’ matches any number of characters (including zero). For example,
- ‘abc%’ matches strings beginning with ‘abc’;
- ‘%xyz’ matches strings ending with ‘xyz’;
- ‘%aaa%’ matches strings containing ‘aaa’;
IN, NOT IN
Another common and important operator is IN. It is quite similar to = but with a cleaner code.
select * from artiste where year in (1973, 1992);