This discussion is archived
6 Replies Latest reply: Jul 29, 2013 6:16 AM by chris227 RSS

pattern matching

981609 Newbie
Currently Being Moderated


Can some show me a SQL where I can get JUST one of these rows back at a time.

 

[code]

SQL> desc t1;
Name                                      Null?    Type
----------------------------------------- -------- ----------------------------
VAL                                                VARCHAR2(20)


insert into t1 values ('ABC_BKPSTBY_P');
insert into t1 values ('ABC_BKP_P');
commit;

 

# This returns 2 rows NO good.

SQL> select val from t1 where val like '%BKP%';

VAL
--------------------
ABC_BKPSTBY_P
ABC_BKP_P


# This returns no rows, no good

 

SQL> select val from t1 where val like '%BKP';

no rows selected

[/code]

 

Thanks to all who answer

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points