chinmay.sahoo
New member
When a partial search is required in a scencario, where for instance, you need to find all employees with the last name having the sequence of characters "gat", then you may use the following query, to match a search criteria:
Select empid, firstname, lastname from t_employee where lastname like ‘%gats%’
This might search all employees with last name containing the character sequence 'gats' like Gates, Gatsby, Gatsburg, Sogatsky, etc.
% is used to represent remaining all characters in the name. This query fetches all records contains gats in the e middle of the string.
Select empid, firstname, lastname from t_employee where lastname like ‘%gats%’
This might search all employees with last name containing the character sequence 'gats' like Gates, Gatsby, Gatsburg, Sogatsky, etc.
% is used to represent remaining all characters in the name. This query fetches all records contains gats in the e middle of the string.