I have three tables…
First table Parameter_value_archive having columns as:
Para_id,para_value,created_date,meter_id.
Sec table meter_primary_master having columns as:
meter_name,meter_id.
third table parameter_master having columns as:
para_name,para_id.
I want to collect data from these three tables and put it in a new table name Meter_specs having columns as:
created_date,meter_id,meter_name,para_name,para_id,para_value.
How do do this ??
To create a new table having the same table definition of a select clause, use
CREATE TABLE ... AS SELECT ...like this:This will make a new table
Meter_specswith the columns:created_date,meter_id,meter_name,para_name,para_id.SQL Fiddle Demo