mySQL - changing field contents to enumerated indices

I have a Domain Name Table  field that is TLD and contains the TLD  text
com
net
org
info

etc.

I have a new table that contains all the TLDs that we use, as indexed by a contiguous index.
1 com
2 org
3 net
etc

is there an easy way WITHIN a SQL statement to match  com  and replace with 1
(or i'm fine to do an intermediary table that will collect the results and then rename the table name accordingly)
willsherwoodAsked:
Who is Participating?

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

x
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.

theGhost_k8Database ConsultantCommented:

Update tld_txt T1, tld T2 set T1.FieldName=T2.id where T1.FieldName=T2.FieldName;

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
willsherwoodAuthor Commented:
ooo that's easy.   thank you!!!
0
willsherwoodAuthor Commented:
elegant!
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.