SQL Change Text To Unique ID Number

GtDriver

i have a MySql database that contains two tables. One table (the 'Country' table) has a list of countries (the columns are unique_id and country_name). The other table (the 'State') table has a list of global regions (equivalent to the U.S' States). Columns in the States table are state_id, state_name, country_name).

I would like to convert all the country names in the 'State' table to the corresponding unique-id in the 'Country' table. Is there a way to do this?

Any help appreciated and thank you in advance.

Aram Antonyan

If you need to select data to see unique id instead of country name you can use inner join

select StateId, StateName, UniqueId from states
INNER JOIN countries
ON states.CountryName = countries.CountryName;

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

SQL finding unique combinations and number of occurances

From Dev

Change Unique ID of HDD

From Dev

How to assign a unique ID number to each group of identical values in a column

From Dev

How to have a unique ID number in CRM Online 2013

From Dev

Unique id number C#

From Dev

Why did my unique device ID change?

From Dev

JQuery How to hide/show dynamic number of divs all with unique id

From Dev

Count the number of expired & unexpired rows for each unique id

From Dev

How to get device phone number or unique id in Swift?

From Dev

Generate unique serial from id number

From Dev

Count number of unique values containing text

From Dev

Bokeh change tick label from a number to text

From Dev

SQL: Get average number of entries for each unique id within another unique id

From Dev

Unique ID of the SQL Server Database

From Dev

How to change a date formatted number into number in SQL

From Dev

Adding a unique ID number to a difference of tables

From Dev

Unique text instead of number

From Dev

Efficiently merge / sort / unique large number of text files

From Dev

SQL SUM, COUNT for only unique id

From Dev

Unique id number C#

From Dev

MySQL - Count Number of Unique Values with Unique Text

From Dev

Search Table for Multiple Results and Unique ID SQL

From Dev

Change div id text content

From Dev

how to change month info text to number?

From Dev

Change the specific text become a number in excel

From Dev

change text with Id by selecting an image with Id

From Dev

VBA change text to number format

From Dev

SQL get number of unique client by browser

From Dev

Change size of text based on number of words - android

Related Related

HotTag

Archive