Hello I have two tables in MySQL. The first table is called users it has a column ID that relates to table 2 which is called family. The family table has two columns, familyID and userID. Basicly what I want to do is concatenate a first name column in the users table where familyIDs are the same.
So if John(userID 1) and Jane(userID 2) have a familyID of 123 it returns a result of 'John and Jane'.
Is this posible with SQL or do I need another programming language like C# and have a logical check?
Updated info: Users Table:
/Column Information/
Field Type Key
----------------- ----------- ------
id int(11) PRI
username varchar(30)
fName varchar(50)
lName varchar(50)
Family Table:
/Column Information/
Field Type Collation Null Key
ID int(11) (NULL) NO MUL
userID int(11) (NULL) YES MUL
/Index Information/
Table Non_unique Key_name Seq_in_index Column_name
family 1 familyUser 1 userID
family 1 familyID 1 ID
Ive tried several joins and even a self join but most of them return data just not what Im looking for as it repeats all the first names join together.
Please let me know if you need any additional info.