Hints
"like" used in where condition with column and values.Opposite to this "not like" also available.
"and" used to compare two column values in where condition.If both condition statisfies select command select the column which is related to that conditions.
"or" used to compare two column values in where condition.If any one condition statisfies select command select the column which is related to that conditions.
In following example like, and , or are used together according to the purpose of task.
|
select columnName from tableName where (columnName like'value' or columnName like 'value' ) and columnName like 'value' ;
|
Get the employee numbers and first names of all employees whose last names have a letter o or a as
the second character and end with the letters es.
select emp_no,emp_fname from Empolyee where (emp_lname like'_o%' or emp_lname like '_a%' )
and emp_lname like '%es' ;
|