You need a third table to setup the many to many relationship between
clients and consultants. A quick summary of the tables will look like this:

tbl_consultant
---------------------
PK consultantId
....

tbl_client
--------------
PK clientId
....

tbl_clientConsultants
------------------------------
PK clientConsultantId
FK consultantId
FK clientId

+ unique constraint/index on consultantId & clientId


Then the SQL to select all of a client's constultants could look like this:

SELECT ct.*
FROM tbl_clients cl
INNER JOIN tbl_clientConsultants cc ON cc.clientId = cl.clientId
INNER JOIN tbl_consultants ct ON ct.consultantId = cc.consultantId
Where cl.active = 1

HTH

Dominic

-- 
Blog it up: http://fusion.dominicwatson.co.uk


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;192386516;25150098;k

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:303388
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to