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?

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

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?
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

Bradley BishopAssociate Product DeveloperCommented:
How did you change the Column? and can you post the specific error you are getting?
Protecting & Securing Your Critical Data

Considering 93 percent of companies file for bankruptcy within 12 months of a disaster that blocked access to their data for 10 days or more, planning for the worst is just smart business. Learn how Acronis Backup integrates security at every stage

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.
Dave BaldwinFixer of ProblemsCommented:
You don't need 'bigint' to go to 9 characters in EmployeeID.  A regular int will accommodate 11 characters.
mark_06Author Commented:
Issue is I have numbers above 2147483647 

When I import the numbers above that, they all come in as 2147483647. Is there a way around it?
mark_06Author Commented:
Also we use 10 digit telephone numbers for Employee ID (from North America), without the "-".
mark_06Author Commented:
any ideas?
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.

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.
Bradley BishopAssociate Product DeveloperCommented:
Sweet good deal!
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.