Home » RDBMS Server » Server Administration » Re: Like command Syntax
Re: Like command Syntax [message #374782] Mon, 02 July 2001 09:41
Hans
Messages: 42
Registered: September 2000
Member
please look at this script
 
drop table tab_a;
create table tab_a (
   col_a    varchar2(30)
);
 
drop table tab_b;
create table tab_b (
   col_b    varchar2(30)
);
 
 
insert into tab_a values ('HOU');
insert into tab_a values ('MUS');
insert into tab_a values ('NUS');
 
insert into tab_b values ('HOU;CAL');
insert into tab_b values ('CAL;HOU');
insert into tab_b values ('CAL;NUS');
 
 
-- Statement 1
select * from tab_a a
   where exists
      ( select 'X' from tab_b b
           where b.col_b like '%' || a.col_a  || '%' );
           
           
-- Statement 2
select distinct a.* from tab_a a, tab_b b
   where b.col_b like '%' || a.col_a || '%';
Previous Topic: Re: JOBS
Next Topic: Re: Like command Syntax
Goto Forum:
  


Current Time: Sat Jul 06 07:20:30 CDT 2024