Tuesday, February 27, 2007

Selecting Column Names, (and Info)

I've been working a lot with ugly CSV files with about 4 trillion rows. (Ok, not 4 trillion, but enough to get sick of them) I found myself looking for rows w/ given names, only to scroll through them when I wasn't going slowly enough. So to fix that I found this

select column_name, data_type, character_maximum_length from information_schema.columns
where table_name = 'myTable'
Which makes things much easier :)

No comments: