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 is cartesian join in sql?

0 Answers  


Explain scalar functions in sql?

0 Answers  


What are the types pl/sql code blocks?

0 Answers  


What is a schema sql?

0 Answers  


What is date functions?

0 Answers  






Is it possible to use Transaction control Statements such a ROLLBACK or COMMIT in Database Trigger ? Why ?

5 Answers  


What are the Restrictions on Cursor Variables?

2 Answers  


i have a table like this. i want to output like this c1 c2 c1 c2 1 10 1 10 2 20 2 30 3 30 3 60 4 40 4 100 5 5 5 105 c1 and c2 are columns in a table .i want output like this c2 values are 10,10+20,10+20+30,10+20+30+40.10+20+30+40+5. write a sql query.pls help this i want urgent.

2 Answers   IBM, Loginworks, OFSS,


What is interval partition?

0 Answers  


A table has 150 records. How do you retrieve 100th row to 120th row from that table ?

21 Answers   IBM,


What are the most important characteristics of pl/sql?

0 Answers  


Does sap use sql?

0 Answers  


Categories