Use two % signs in like : Like « Select Query « Oracle PL / SQL






Use two % signs in like

    
SQL>
SQL> CREATE TABLE product (
  2       product_name     VARCHAR2(25),
  3       product_price    NUMBER(4,2),
  4       quantity_on_hand NUMBER(5,0),
  5       last_stock_date  DATE);

Table created.

SQL>
SQL> INSERT INTO product VALUES ('Small Widget', 99, 1,    '15-JAN-03');

1 row created.

SQL> INSERT INTO product VALUES ('Wodget',       75, 1000, '15-JAN-02');

1 row created.

SQL> INSERT INTO product VALUES ('Product 1',    50, 100,  '15-JAN-03');

1 row created.

SQL> INSERT INTO product VALUES ('Product 2',    25, 10000, null);

1 row created.

SQL>
SQL> SELECT * FROM product WHERE  product_name LIKE '%W_d%';

PRODUCT_NAME              PRODUCT_PRICE QUANTITY_ON_HAND LAST_STOC
------------------------- ------------- ---------------- ---------
Small Widget                         99                1 15-JAN-03
Wodget                               75             1000 15-JAN-02

2 rows selected.

SQL>
SQL>
SQL> DROP TABLE product;

Table dropped.

SQL>

   
    
    
  








Related examples in the same category

1.A function using the LIKE operator to return a phone number's area code
2.Like with '__' (Any two characters)
3.Like with '_' and '%'
4.Use two '%' in Like statement
5.Using a NOT operator with like
6.Convert varchar value to upper case and then use like operator
7.Is Like case sensitive
8.Use % in word ending
9.Use two % signs in one like
10.Like '%' function with varchar2 type
11.Like with % on both sides
12.Second letter is A
13.Create pattern dynamically and use it in like statement
14.Pattern Matching LIKE '%great%'
15.Using Pattern Matching LIKE '____ %'
16.comments like '%0\%%' escape '\'
17.Escape \
18.Description has 'SQL' substring