Thursday, August 20, 2009

how to update multiple columns in SQL?

i had a hard time on figuring this out at first with only looking for this in google or sql sites, so i would like to share what i learned on updating sql multiple columns.

here is how,

so the syntax of updating multiple columns:

UPDATE [table name] SET [Field Name] = [new Value], [another Field Name] = [new Value], [another Field Name] = [new Value] WHERE [constraint's column] = ["Value"] ;

on your console or on your php query,

UPDATE student_table set name = "honeytechie", site="http://honeytechie.blogspot.com" where student_id = 123;

No comments:

Post a Comment