I am looking for some help/ideas on how to structure (table wise) infinitely nest groups in SQL.

```
EX.
group1 will contain  a,b,c
group2 will contain  d,e,f
group3 will contain  h,i,j
group4 will contain  k.l.m

groupA will contain group1,group2
groupB will contain group3

groupA1 will contain groupA,groupB,group4

```

each lowest level group will refer to a list of scans in a different table (in this example lets say group1 group2 group3 and group4 are the lowest level)

this should be able to support an infinite number of groups

I know this is vague but i am trying to find out how to structure and manage something like this...

I am trying for both tables and queries. So far I have this:

```
Scan Table
((uniqueID),barcode,user,date,group)
Groups Table
(groupID,groupName,groupRef)

```

but i am having trouble "Creating" GroupA

in terms of queries i would need to know what are the lower level groups and get a list of all items in a group.