What are all the difference between Like and Contains ?

Answers were Sorted based on User's Feedback



What are all the difference between Like and Contains ?..

Answer / rubyna

Like gives additional option of specifying exact
string/character position in the text. eg. if we want to
search all words having second letter 'a', we can use like,
but cannot use contain-

select * from emp where emp.name like '_a%'.

We don't have corresponding statement with contains.

Is This Answer Correct ?    4 Yes 0 No

What are all the difference between Like and Contains ?..

Answer / santosh acharya

Select * from myTable where textField like '%Cats and Dogs%'

Select * from myTable where CONTAINS(textField, '"Cats and
Dogs"')

Both options will only return rows that contain the exact
phrase "Cats and Dogs", neither will return records that
contain either "Cats" or "Dogs" in them.

Is This Answer Correct ?    2 Yes 6 No

Post New Answer

More SQL PLSQL Interview Questions

What kind of join is join?

0 Answers  


What do you mean by field in sql?

0 Answers  


The in operator may be used if you know the exact value you want to return for at least one of the columns.

0 Answers  


What is difference between pls_integer and integer?

0 Answers  


We have a CURSOR then we need BULK COLLECT?

1 Answers  






can i use global variables in stored procedure or function

1 Answers   L&T,


How do I truncate a sql log file?

0 Answers  


What program will open a mdb file?

0 Answers  


Can I call a procedure inside a function?

0 Answers  


What is nested table in pl sql?

0 Answers  


Write a query to find second highest salary of an employee.

27 Answers  


How will you select unique values from a list of records?

7 Answers   Cap Gemini,


Categories