Tumblelog by Soup.io
Newer posts are loading.
You are at the newest post.
Click here to check if anything new just came in.

November 17 2010


How do I correct datatypes for mysql spreadsheet


I've imported a spreadsheet of U.S. Government statistics into a mysql table with the aim of working through a tutorial.

However, it would appear that the U.S. Government has changed its formatting so that some of numerical figures are wrapped in quote marks, turning them into strings.

For example, this is the format of the tab-separated data that I'm supposed to have downloaded:

CN010010 01 001 "Autauga County, AL" 2005 23831 23061 770 3.2

However, it looks like this: CN010010 01 001 "Autauga County, AL" 2005 "23,831 " "23,061 " 770 3.2

As a result the two key columns of data (the 23831 and 23061 bits) that I want to import as integers are registering as 0 - presumably because it doesn't meet the data type.

What's the best solution for resolving this problem, now and in the future?

Thanks in advance.


Tags: mysql newbie

May 25 2010


Building a Better Submission Form

Our new photo uploader, called Stuffy, uses a NoSQL storage engine for speed and flexibility.
Sponsored post

April 30 2010


MySQL query help - year over year query?

Let's say a table has two fields: a date and the closing price of a stock. Is there a single query that could return several years of daily closing prices, grouped by year? How would one construct a third column for year over year percent change?

Tags: mysql sql query

February 02 2010

Older posts are this way If this message doesn't go away, click anywhere on the page to continue loading posts.
Could not load more posts
Maybe Soup is currently being updated? I'll try again automatically in a few seconds...
Just a second, loading more posts...
You've reached the end.
No Soup for you

Don't be the product, buy the product!

YES, I want to SOUP ●UP for ...