Hey need help of adding data T__T
-
EDIT: I Guess this makes my problem clearer i have 2 tables Mother with Columns (Name,NameKey) and Children with Columns(child,childkey,Mother.NameKey) i want to connect 2 tables and insert many children in 1 mother is this code possible? can't try it right now
insert into children(mother.namekey,child) values (Select namekey from mother where name='TELMA'),BEN,RON,DONNA)
i know my codes above have errors even w/o trying it. i just want to know how to make that happen and get this output MOTHER- CHILDREN TELMA..............BEN ............................RON ...........................Donna -
EDIT: I Guess this makes my problem clearer i have 2 tables Mother with Columns (Name,NameKey) and Children with Columns(child,childkey,Mother.NameKey) i want to connect 2 tables and insert many children in 1 mother is this code possible? can't try it right now
insert into children(mother.namekey,child) values (Select namekey from mother where name='TELMA'),BEN,RON,DONNA)
i know my codes above have errors even w/o trying it. i just want to know how to make that happen and get this output MOTHER- CHILDREN TELMA..............BEN ............................RON ...........................DonnaHave you tried (have assumed that this is SQL Server)
insert into family (children) values
select 'ben'
union
select 'ron'
union
select 'donna'Every day, thousands of innocent plants are killed by vegetarians. Help end the violence EAT BACON
-
EDIT: I Guess this makes my problem clearer i have 2 tables Mother with Columns (Name,NameKey) and Children with Columns(child,childkey,Mother.NameKey) i want to connect 2 tables and insert many children in 1 mother is this code possible? can't try it right now
insert into children(mother.namekey,child) values (Select namekey from mother where name='TELMA'),BEN,RON,DONNA)
i know my codes above have errors even w/o trying it. i just want to know how to make that happen and get this output MOTHER- CHILDREN TELMA..............BEN ............................RON ...........................DonnaAl Arcilla wrote:
i have a table family
columns (MOTHER,CHILDREN)How did you create it? Can you post the
CREATE TABLE
statement?Al Arcilla wrote:
how can i have an output like that?
Is the problem in getting the "output" based on the data, or getting the data in the table?
Al Arcilla wrote:
this is the code i try i know this will not work
What does "not work" mean? Did it execute succesfull or throw an exception? If there was an error, which one? Can you post it? I'm going to guess that your "mother" column isn't a primary key, nor an identity. In that case, it'll need a value when you do the insert;
INSERT INTO [family] (MOTHER,CHILDREN)
VALUES ("Mother", "Ben");Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]
-
EDIT: I Guess this makes my problem clearer i have 2 tables Mother with Columns (Name,NameKey) and Children with Columns(child,childkey,Mother.NameKey) i want to connect 2 tables and insert many children in 1 mother is this code possible? can't try it right now
insert into children(mother.namekey,child) values (Select namekey from mother where name='TELMA'),BEN,RON,DONNA)
i know my codes above have errors even w/o trying it. i just want to know how to make that happen and get this output MOTHER- CHILDREN TELMA..............BEN ............................RON ...........................DonnaUP for my question