mysql int to bigint

Hi Guys,

I had a query working perfectly and then I had to change from INT to BIGINT in order to cater for some extra long numbers... Now my query doesn't work.

SELECT EmployeeID, location, type, zip FROM Table1 WHERE EmployeeID NOT IN (SELECT EmployeeID FROM Table2);

Can you please help me? How can I get this to work again?

Thanks
LVL 6
mark_06Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bradley BishopAssociate Product DeveloperCommented:
What field was changed? Is the column allowed to be null?
0
mark_06Author Commented:
It was EmployeeID that was changed.

Not sure about NULL, I have provided an explain of the query

| id | select_type        | table  | type           | possible_keys | key         | key_len | ref  | rows  | Extra                              |
+----+--------------------+--------+----------------+---------------+-------------+---------+------+-------+------------------------------------+
|  1 | PRIMARY            | Table1 | ALL            | NULL          | NULL        | NULL    | NULL | 16799 | Using where                        |
|  2 | DEPENDENT SUBQUERY | Table2 | index_subquery | EmployeeID   | EmployeeID | 9       | func |   498 | Using index; Full scan on NULL key |

Open in new window

0
Bradley BishopAssociate Product DeveloperCommented:
How did you change the Column? and can you post the specific error you are getting?
0
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

mark_06Author Commented:
its not an error, just no results. First I tried an ALTER TABLE then when I was getting no results I dropped the table and re-added it with the column as BIGINT and imported the data again.
0
Dave BaldwinFixer of ProblemsCommented:
You don't need 'bigint' to go to 9 characters in EmployeeID.  A regular int will accommodate 11 characters.
0
mark_06Author Commented:
Issue is I have numbers above 2147483647
http://dev.mysql.com/doc/refman/5.6/en/integer-types.html 

When I import the numbers above that, they all come in as 2147483647. Is there a way around it?
0
mark_06Author Commented:
Also we use 10 digit telephone numbers for Employee ID (from North America), without the "-".
0
mark_06Author Commented:
any ideas?
0
Bradley BishopAssociate Product DeveloperCommented:
I just created a test database and ran your exact query and it worked fine.

Couple things:
Make sure that your data is properly imported into both tables.
Restart the server
If it is still not working can you attach pictures of the table designs as well as keys that there might be. I would be looking for allow for Null and datatypes.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mark_06Author Commented:
Thanks it was NULL values. I have a bash script importing the data, so once its done importing it issues remove of all NULL.
0
Bradley BishopAssociate Product DeveloperCommented:
Sweet good deal!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
MySQL Server

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.