Re: URGENT Join question

From: TurkBear <noone_at_nowhere.com>
Date: Mon, 13 Aug 2001 08:56:58 -0500
Message-ID: <iomfntc7gqbbffjtonkjtp3nr5ga2092ei_at_4ax.com>


This will still return 1 row from table 2 since HELLO WORLD NOW is not equal to HELLO WORLD ( so col1 of table1's row 2 is HELLO WORLD NOW which is <> to col1 of table 1)

Try:
select distinct b.col1,b.col2 from table2 b , table1 a  where b.col1||'%' not like a.col1||'%' and a.col2 = b.col2 ;

"Peter Davey" <psvdavey_at_hotmail.com> wrote:

>I'd try something like:
>
>SELECT col1, col2 FROM table2
>WHERE col1 NOT IN
>( SELECT col1 FROM table1);
>
>Best regards
>Peter Davey
>
>"Manoj Nair" <debo_nair_at_yahoo.com> wrote in message
>news:92a0e580.0108081623.651e99a5_at_posting.google.com...
>> I have 2 tables
>>
>> Table 1
>> col 1 varchar2
>> col 2 numeric
>>
>> Table 2
>> col 1 varchar2
>> col 2 numric
>>
>> Table 1 data
>> HELLO WORLD 1
>> HELLO WORLD NOW 1
>>
>> Table 2 data
>> HELLO WORLD 1
>>
>> when i run
>>
>> select distinct b.col1,b.col2 from table2 b , table1 a where b.col1
>> <> a.col1 and a.col2 = b.col2 I want no records to be returned
>> cos HELLO WORLD is already present in table 1..
>>
>> however it returns HELLO WORLD NOW 1
>>
>> Thanks
>

-----= Posted via Newsfeeds.Com, Uncensored Usenet News =----- http://www.newsfeeds.com - The #1 Newsgroup Service in the World! -----== Over 80,000 Newsgroups - 16 Different Servers! =----- Received on Mon Aug 13 2001 - 15:56:58 CEST

Original text of this message