Sql Query To Use a ' SELECT ' statement with LIKE Clause
To retrieve a record having a specific pattern in a record from the existing created table. Then we can use a ' WHERE ' Clause with LIKE Operator.
- % - In 1st statement, it will retrieve the first_name having specific syntax “ra” in it from the table employees.
- _ - In 2nd statement,it will retrieve the first_name having specific syntax “ar” in it with one character below it and as many as character above it, from the table employees.
- _ and __ - In 3rd statement,it will retrieve the first_name having specific syntax “ar” in it with one character below it and two character above it, from the table employees.
- %a _r% - In 4th statement,it will retrieve the value that having one character between a and r, start and end with any number of characters below and above a_r, from the table employees.