I would have another table, related_wigets, with the following structure:
widgetid (number, PK, FK)
related_widgetid (number, PK, FK)
When someone wants to relate widget with widgetid = 1 to widget with widgetid = 2, do an insert like so:
INSERT INTO related_widgets (widgetid, related_widgetid)
VALUES (1, 2)
When you want a full list of which widgets are related to widget with widgetid = 3, the following query will give you a complete list:
SELECT * FROM related_widgets
WHERE widgetid = 3 OR related_widgetid = 3
Hope this helps,
darkagn
Reputation Points: 395
Solved Threads: 192
Veteran Poster
Offline 1,136 posts
since Aug 2007