Selecting Pattern Matching Data by Using the Like operator in a T-SQL Query

Say you want to retrieve all of the authors whose last names started with an L, M, or S. Here’s the query:

 select au_lname, au_fname from authors where au_lname like '[LMS]%'au_lname                                 au_fname---------------------------------------- --------------------Locksley                                 CharleneMacFeather                               StearnsMcBadden                                 HeatherSmith                                    MeanderStraight                                 DeanStringer

Share the Post:
Share on facebook
Share on twitter
Share on linkedin


Recent Articles: