4 messages in com.mysql.lists.mysqlRe: add a column if not exists
FromSent OnAttachments
Claire Lee26 Sep 2005 09:43 
Gleb Paharenko26 Sep 2005 10:21 
Peter Brawley26 Sep 2005 10:49 
Pooly26 Sep 2005 14:06 
Subject:Re: add a column if not exists
From:Gleb Paharenko (gleb@ensita.net)
Date:09/26/2005 10:21:02 AM
List:com.mysql.lists.mysql

Hello.

You can parse the output of 'SHOW CREATE TABLE' or 'SHOW COLUMNS'. See: http://dev.mysql.com/doc/mysql/en/show-columns.html http://dev.mysql.com/doc/mysql/en/show-create-table.html

Claire Lee wrote:

I want to check if a column exists in a table before I do an alter table to add it. How do I do this in mysql? Thanks.

Claire