Subject Re: [firebird-support] Re: Need advice on SQL & table design.
Author Martijn Tonies
Hi,

> > I would do as you suggest - a relations table and then a join to
> give you a
> > resultset giving multiple people with each of their flags. I would,
> however,
> > use a treeview which handles the multiple people as groupings quite
> well.
>
> Thanks Alan
>
> I don't want to group the people at all, I need something like this
>
> Name Flags
> --------------------------------------------
> Fred Retired, Golfer, Subscribed
> Bob Retired, Fisherman
> Jack Employed, Family
>
> If I use the relations table, I don't know how I can retrieve a
> persons details + flags in a single select (even using a join, unless
> some names are duplicated)
>
> Maybe it's not possable to do what I want with the relation table,
> hence my thought of using an array within the PEOPLE table, although
> that's a bit of a ludge.

You cannot do this with a join, however, you CAN do this
with a selectable stored procedure - make it an inline select
and let the procedure select the flags and concat them into
the output string.

With regards,

Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server.
Upscene Productions
http://www.upscene.com