Click here to Skip to main content
15,881,809 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,
Im trying to update a table rows from data which presents in another table...
Data is updating but if another table contains multiple vales, updating table gets only single data. example


SQL
UPDATE RPT SET RPT.T3=GRP.VALUE FROM RPT INNER JOIN GRP ON RPT.T1=GRP.COL1 AND GRP.COL1='STUDENT1'


Here value column in grp table contains 5 values like....
SQL
SELECT VALUE FROM GRP WHERE COL1='STUDENT1'

23
25
13
10
11

But when im using the update command mentioned above, only value(23) is inserting into rpt table into 5 rows of data...

Please help me in this to insert multiple values from one table to multiple rows in another table in single update command...

[edit]SHOUTING removed - OriginalGriff[/edit]
Posted
Updated 23-Oct-14 21:17pm
v3
Comments
OriginalGriff 24-Oct-14 2:55am    
DON'T SHOUT. Using all capitals is considered shouting on the internet, and rude (using all lower case is considered childish). Use proper capitalization if you want to be taken seriously.
chaitanya556 24-Oct-14 2:58am    
ok sorry... But please help me in this....
OriginalGriff 24-Oct-14 3:06am    
Sorry, but no.
You started off the discussion by being rude and shouting at me, and I personally do not answer such questions, or indeed even look at the detail of them.

Others may have different opinions, but that's mine.
Sergey Alexandrovich Kryukov 24-Oct-14 2:58am    
"Update with SELECT command"... Can you hear the absurdity in this phrase? Even if the question itself makes sense, you need to think a bit at your titles. Some may not want to open this page if they see such title... :-)
—SA
Maciej Los 24-Oct-14 2:59am    
We don't see your screen. Please, provide more details about your issue, like: sample data and expected output.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900