If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ANSI SQL > No-duplicate record from query

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-08-03, 12:33
fartman fartman is offline
Registered User
 
Join Date: Oct 2003
Posts: 6
Red face No-duplicate record from query

Hi,
I have 2 tables on DB2 version 6

Tab_A
id name
1 shop1
2 shop2

Tab_B
id_tab_a keyword
1 book
1 bookstore
1 handbook
2 restaurant

I need to write a SQL query that find who have 'book' as keyword on Tab_B, but with no duplicated record. If i write:
Select distinct id, name left join Tab_B on id=id_tab_a where
keyword like '%book%'
obtain 3 duplicated records.
Any ideas?

Thanks,
Jhon
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On