Coolness 
While talking with Dynom and Davey I learned something really cool today - how to get the declared definition of a column all by itself with MySQL (I used version 5.0.45). Yes there are lots of other ways to get the info - not the least of which is using the information_schema - but this just struck me as being way cool.
You can even use wildcards in the column name. From a different database (note you have to have the perms to access the alternate database):
DESCRIBE Db.table column;
Example from my test db:
mysql> describe lig_test.student guardianship; +--------------+---------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +--------------+---------+------+-----+---------+-------+ | guardianship | char(1) | NO | | | | +--------------+---------+------+-----+---------+-------+ 1 row in set (0.08 sec) mysql> describe lig_test.student 'guard%'; +----------------+----------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +----------------+----------+------+-----+---------+-------+ | guardian_photo | longblob | YES | | NULL | | | guardianship | char(1) | NO | | | | +----------------+----------+------+-----+---------+-------+ 2 rows in set (0.01 sec)
March 6th, 2008 at 10:03 am
Nice one. Works on 4.1 too. Thanks.
PS: welcome back to the internet
March 7th, 2008 at 12:33 am
Beautiful. I will put it to good use before the day is done.
Lig, you rock!
April 2nd, 2008 at 4:58 pm
Hoho! So nice, thanks for this tip!