I'm no expert, but I'm pretty sure ALTER TABLE commands don't have FROM or WHERE clauses.
dev.mysql.com has full documentation of MySQL's SQL syntax; I make frequent use of it. ~B > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Behalf Of Michael Rulison > Sent: Friday, November 24, 2006 2:02 PM > To: Triangle Linux Users Group discussion list > Subject: [TriLUG] MySQL - Alter Table command > > > I am trying to catenate two columns from b onto c, making sure that the > field 'name' is matched before each record is added with the > following sql: > > ALTER TABLE cust_extract AS c ADD COLUMN prev_billing_date, > ADD COLUMN next_billing_date FROM billing AS b WHERE c.name = b.name > > I get this error message: > > #1064 - You have an error in your SQL syntax; check the manual that > corresponds to your MySQL server version for the right syntax to use > near 'as c add column prev_billing_date > FROM billing AS b > WHERE c.name = b.name' at line 1 > > With thanks to those with sharper eyes than mine, > > Mike Rulison > ------------------------------------------------------------------------ > Go to source>> > <http://mysql.meetup.com/144/boards/view/viewthread?thread=2439669> > -- > TriLUG mailing list : http://www.trilug.org/mailman/listinfo/trilug > TriLUG Organizational FAQ : http://trilug.org/faq/ > TriLUG Member Services FAQ : http://members.trilug.org/services_faq/ > -- TriLUG mailing list : http://www.trilug.org/mailman/listinfo/trilug TriLUG Organizational FAQ : http://trilug.org/faq/ TriLUG Member Services FAQ : http://members.trilug.org/services_faq/
