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!

Find column values ending with _2

VitaminDMay 15 2018 — edited May 15 2018

DB version: 11.2.0.4

I need to find all the column values in txtfield column which ends with _2 .

Expected answer is keith_2. How can I do that ? My below attempts failed.

SQL> create table t3 ( txtfield varchar2(20));

Table created.

SQL> insert into t3 values ( 'hello');

1 row created.

SQL> insert into t3 values ( 'keith_2');

1 row created.

SQL> insert into t3 values ( 'simon_2emp');

1 row created.

SQL> commit;

Commit complete.

SQL> select * From t3 where txtfield like '\_2%' escape '\';

no rows selected

SQL> select * From t3 where txtfield like '\_2%';

no rows selected

no rows selected

This post has been answered by BrunoVroman on May 15 2018
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 12 2018
Added on May 15 2018
4 comments
1,626 views