🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: bit.listserv.sqlinfo
Article #235

Help joining table attributes...

#235
From: Shawn Hughes
Date: Mon, 14 Aug 2000 00:00
28 lines
1262 bytes
How do you group attributes from one table
and 'OR' the elements from one group and
'AND' the sets of results.  For example...

table tab1(index keyname)
keyname     group
a                          1
b                          1
c                          2

table tab2 (index id, keyname)
id                    keyname
1001                    a
1002                    a
1002                    c
1003                    b
1003                    c
1004                    c

My query is "Give me the articles which have (either attribute
'a' or attribute 'b') AND attribute 'c'.

Based on this set, I need to select id=1002 (because it has both
'a' and 'c' attributes) and id=1003 ('b' and 'c').

Any pointers would be appreciated.

Shawn.
Technical Details
Message-ID: <39987A56.6F85CFC4@jpmorgan.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11355a,cffead133f4a2969,start
X-Google-Attributes: gid11355a,public
From: Shawn Hughes <hughes_shawn@jpmorgan.com>
Subject: Help joining table attributes...
Date: 2000/08/14
Message-ID: <39987A56.6F85CFC4@jpmorgan.com>
X-Deja-AN: 658419507
Content-Transfer-Encoding: 7bit
Organization: J.P. Morgan & Co
X-Accept-Language: en
Content-Type: text/plain; charset=us-ascii
Mime-Version: 1.0
Newsgroups: bit.listserv.sqlinfo