Saturday 14 September 2013

SQL Like

Like ;-it is used for filtering the records or you search a data by providing the specific pattern.
mainly used in searching.we are using two wild card characters:-
1) %  (strings or group of characters)
2)_ (represents single character).

we use this table on which we perform operations



Ex:-s% means that string should be start from 's' and after have it may have any number of characters.


 Ex:-%l means in starting string may have any number of characters but string must be end on 'l'

 Ex:-t%l means string must start from 't' and ends with 'l' between 't' and 'l' it may contains any number of characters.

Ex:- s_l means that string must be start from 's' and ends with 'l' but between 's' and 'l' it may contain only one character.


Ex:-in this the length of string is 2 the string starts with any character and should be end on 'l'.in our table we have no such kind of name so we get empty table.


 Ex:-the length of string is 3 string should be start  from "sq" and ends on any one character.



Ex:-in this in the place of  "_" we take only one character and in the place "%" we take any number of characters.



No comments :

Post a Comment