-7

What does LIKE'%aa%' exactly do? Is it case-sensitive?

Mhy
  • 187
  • 3
  • 10

4 Answers4

2

The LIKE operator is used in a WHERE clause to search for a specified pattern in a column.

e.g. WHERE CustomerName LIKE '%aa%'

Finds any values that have "aa" in any position

Bahadur Singh Deol
  • 753
  • 2
  • 6
  • 17
1

It retrieves all the strings having the VALUE = "aa" from DataBase.

Gurdyal
  • 161
  • 2
  • 2
  • 11
1

in a where clause it looks for anything which would contain 'aa'.

% acts a wildcard so anything can be before it or after it

dbajtr
  • 2,024
  • 2
  • 14
  • 22
1

It search for a record in which the field in the condition contains the literal, in this case 'aa'.

For instance:

Select * from Employee
where Name like '%aa%'

It retrieves all employees where the names contains the literal 'aa'..

Regards!!!

Dadep
  • 2,796
  • 5
  • 27
  • 40