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 > Database Server Software > DB2 > Filtering Record Output

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-09-10, 10:24
db2hack db2hack is offline
Registered User
 
Join Date: Nov 2010
Posts: 4
Question Filtering Record Output

I'm a hack at best with SQL. I want to only display a record if a string from a field in query 2 is found in a particular field in query 1.

query 1 output looks like this:

Microsoft .NET Framework 1.1 Security Update (KB953297)
Security Update for Microsoft Office Access 2007 (KB979440)
Security Update for Microsoft Office Outlook 2007 (KB972363)
Security Update for Microsoft Office Word 2007 (KB2251419)
Windows Installer 3.1 (KB893803)
Security Update for Microsoft .NET Framework 2.0 (KB917283)
Security Update for Windows XP (KB890046)

query 2 output looks like this:

981716
979440
2229593
2286198
980436

So I only want to display a record from query 1 if it contains one of the values found in the list of values in query 2.

Thanks.
Reply With Quote
  #2 (permalink)  
Old 11-09-10, 10:36
Cougar8000 Cougar8000 is offline
Registered User
 
Join Date: Nov 2005
Location: IL
Posts: 554
ahh, it is right behind door #1


You might want to provide a table structure and take a first stab at it.
__________________
--
IBM Certified DBA on DB2 for Linux, UNIX, and Windows

DB2 v9.1.0.2 os 5.3.0.0
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