Interviews1 answer
I have a table Table1. It's have four collumns Name, Age, Address, Friends.. One Pursion have a Name, Age, Address but He have many Friends.. So how Inserted a many friends name in a single collumn........
Neeraj Srivastava
Posted Mar 28, 2009, 9:39 PM EDT1 Answer
HI Neeraj,
y u r inserting Name of Friend. I think u have a primary key in this table. I think u want to fetch all friend of a single person. Have u a Column in this table Such as MyFriend or u have seperate table to keep friend record. If u r making seperate table then u can insert Id of that person
and that person's friend ID in a seperate row, Mean If A have 4 friend then there will be 4 row for A. Here in person ID column There will be A's ID and in friend Column there will be different-different Friend ID.
Suppose if u have no seperate table and u have a column to keep friend' record then u can update that table with person ID u can use ,
like 1,2,3,4
Next Time it will be 1,2,3,4,5
Rahul Kumar SaxenaPosted Mar 30, 2009, 12:40 AM EDT
