Updating multiple fields in sql Sexchat adultos argenti

I know I could open table2 and loop through within my app; just wondering about a single SQL statement that would do it. How can I update the color field in table 2 to correspond with the colorfield in table1 (so I can normalize the db and delete the color field fromtable1)?

How can I update the color field in table 2 to correspond with the color field in table1 (so I can normalize the db and delete the color field from table1)?

I need to update several hundred visits with the same note and tried to do a test note on my demo db and when I executed the script, no rows were updated.

Is their a secret to updating multiple fields from one table?

Field2, (list of fields...) FROM ( SELECT Field1, Field2, (list of fields...) FROM Profiler The "tiresome way" is standard SQL and how mainstream RDBMS do it. With a 100 columns, you mostly likely have a design problem... =, = or when the subquery is used as an expression. --What I think is if the same names have different values it will be very hard to distinguish between the same names --with different colors.correct me if i am wrong Hugo Kornelis wrote: Table1Name Something Color-----------------------------------------John GHAS Blue John DDSS Blue John EESS Blue Paul xxxx Red Ringo HJKS Red Ringo FFFS Red Sara hjkd Purple Sara TTHE Purple Jimi sdkjls Green Table2Name Color------------------------John ? Here's a code that will throw an error if there is more than one matching color: UPDATE Table2 SET Color = (SELECT DISTINCT Color FROM Table1 WHERE Table1. Name) Best, Hugo -- (Remove _NO_ and _SPAM_ to get my e-mail address) Yes.The real question is in the requirement not in the solution: What do you want to happen if a single name has more than one colour?

Search for updating multiple fields in sql:

updating multiple fields in sql-43

Leave a Reply

Your email address will not be published. Required fields are marked *

One thought on “updating multiple fields in sql”