Skip to main content
tag, format, changed a few words to try and word a bit better (roll it back if I got it wrong)
Source Link
user507
user507

Here is my problem.I have two tables 'Stdd'Stdd and 'result'result. 'stdd' have fields id,fname,lname,gender,phonenum,city AND 'result' have

stdd columns physics,chem,math,english,urdu,bio,total,id. I:

id
fname
lname
gender
phonenum
city

result columns:

physics
chem
math
english
urdu
bio
total
id

I want that in 'result'result table idthe column id copy data from 'stdd' idstdd column id, and other columns(fields) of 'result'result columns remain empty or null.How

How can i do this please help. I I try this but nor works for me

       update result set  id= (select id from stdd)

following error come

       Msg 512, Level 16, State 1, Line 1
       Subquery returned more than 1 value. This is not permitted when  the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.
       The statement has been terminated.

Msg 512, Level 16, State 1, Line 1 Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression. The statement has been terminated.

I want this kind of output.Here is 'result' table link

I'm using microsoft sql server 2008

Here is my problem.I have two tables 'Stdd' and 'result'. 'stdd' have fields id,fname,lname,gender,phonenum,city AND 'result' have columns physics,chem,math,english,urdu,bio,total,id. I want that in 'result' table id copy data from 'stdd' id and other columns(fields) of 'result' columns remain empty or null.How can i do this please help. I try this but nor works for me

       update result set  id= (select id from stdd)

following error come

       Msg 512, Level 16, State 1, Line 1
       Subquery returned more than 1 value. This is not permitted when  the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.
       The statement has been terminated.

I want this kind of output.Here is 'result' table link

I'm using microsoft sql server 2008

Here is my problem.I have two tables Stdd and result.

stdd columns:

id
fname
lname
gender
phonenum
city

result columns:

physics
chem
math
english
urdu
bio
total
id

I want that in result table the column id copy data from stdd column id, and other columns of result columns remain empty or null.

How can i do this please help. I try this but nor works for me

       update result set  id= (select id from stdd)

following error come

Msg 512, Level 16, State 1, Line 1 Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression. The statement has been terminated.

I want this kind of output.Here is 'result' table link

I'm using microsoft sql server 2008

Source Link

How can copy one column data of one table1 into other table2 column and other clumns table2 empty?

Here is my problem.I have two tables 'Stdd' and 'result'. 'stdd' have fields id,fname,lname,gender,phonenum,city AND 'result' have columns physics,chem,math,english,urdu,bio,total,id. I want that in 'result' table id copy data from 'stdd' id and other columns(fields) of 'result' columns remain empty or null.How can i do this please help. I try this but nor works for me

       update result set  id= (select id from stdd)

following error come

       Msg 512, Level 16, State 1, Line 1
       Subquery returned more than 1 value. This is not permitted when  the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.
       The statement has been terminated.

I want this kind of output.Here is 'result' table link

I'm using microsoft sql server 2008