Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

What exactly is difference between "in" and "like"

sql enthusiastApr 19 2014 — edited Apr 19 2014

Hi there,

I wrote the following query which I believe is same but it doesn't yield the same result !

select * from OE.PRODUCT_INFORMATION where product_name in ('HD%','GP%');

select * from OE.PRODUCT_INFORMATION where product_name like 'HD%' or product_name like 'GP%';

So when I write in IN it should still select any product beginning with HD OR GP right ? but that doesn't happen and no result is returned when I execute the one with IN operator

Technically both should give same result right ?

Please guide me here.

This post has been answered by fac586 on Apr 19 2014
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 17 2014
Added on Apr 19 2014
5 comments
770 views