user13262794
user13262794

Reputation: 29

Dimension and fact table creating in Pentaho from single SQL table(source table)

I have one CSV file, has all info, I converted all info into the one table and stored it in MySQL. It has many fields. What is the best approach to create a table like this: How can I set the auto-increment primary key for my table and how can I get a unique name from the source table.

Upvotes: 0

Views: 111

Answers (1)

GMB
GMB

Reputation: 222632

You would typically create a table with an auto_incremented primary key, and then feed it using select distinct:

create table disticts(
    district_id int auto_increment primary key,
    district_name varchar(100)
);

insert into disticts (district_name)
select distinct district_name from mytable

Upvotes: 1

Related Questions