Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

adding multiple categories in a product table

0 views
Skip to first unread message

Frank Hickman

unread,
Jan 27, 2004, 4:20:17 PM1/27/04
to
Without getting to deep into the answer, I would create a table say,
ProductCategories with two long integer number columns called ProductID and
CategoryID. Add rows as needed. Then you can get a list of categories for
a specific product something like this...

SELECT DISTINCT [Categories].[CategoryName], [ProductCategory].[ProductID]
FROM [Categories] INNER JOIN [ProductCategory] ON
[Categories].[CategoryID]=[ProductCategory].[CategoryID]
WHERE ((([ProductCategory].[ProductID])=1));

or even...

SELECT DISTINCT [CategoryName]
FROM [Categories]
WHERE [CategoryID] IN (SELECT [CategoryID] FROM [ProductCategory] WHERE
[ProductID] = 1)

HTH
--
============
Frank Hickman
NobleSoft, Inc.
============
Replace the _nosp@m_ with @ to reply.

"goescorted" <er...@freestyletravel.no.REMOVE_CAPS> wrote in message
news:6B6EA854-7B81-416F...@microsoft.com...
> I need help with a tricky questions which I belive have a simple solution?
For those who know Nwind.mdb, the example database that comes with microsoft
access, it has several different tables. One of them is categories. What I
need to do is somehow make it possible for a product to be listed in several
categories. However, I do not know how to do this. Does anyone have a
clue??? Any help is appreciated!


0 new messages