Wildcard is use to find SUBSTRING.
There are 3 methods for using these,
1) % It substitutes zero or more character.
Eg: select * from details where city LIKE 'ber%';->It returns citynames start with 'ber'.
2) _ it substitutes only 1 character.
Eg: select * from details where city LIKE '_erlin';->It returns cityname start with any character followed by 'erlin'.
3) [charlist] Sets range of character.
Eg: select * from details where city LIKE '[a-c]%';->It returns cityname start with a,b or c .
There are 3 methods for using these,
1) % It substitutes zero or more character.
Eg: select * from details where city LIKE 'ber%';->It returns citynames start with 'ber'.
2) _ it substitutes only 1 character.
Eg: select * from details where city LIKE '_erlin';->It returns cityname start with any character followed by 'erlin'.
3) [charlist] Sets range of character.
Eg: select * from details where city LIKE '[a-c]%';->It returns cityname start with a,b or c .
No comments:
Post a Comment