I am Creating two table in Postgres.
1st table have one primary column and other columns & in 2nd table have one primary column "MLeaseId" those column same in 1st table (not primary of 1st table) and others column.
How I copy data from 1st table column to second column data?
CREATE TABLE leasetype (
"LeaseTypeId" integer NOT NULL ,
"MLeaseId" character varying(45) NOT NULL,
"Resident" integer NOT NULL,
"Business" integer NOT NULL,
"RArea" float NULL,
"BArea" float NULL,
"RRent" double NULL,
"BRent" double NULL,
PRIMARY KEY (LeaseTypeId)
);
CREATE TABLE masterlease (
"SrNo" integer unsigned NOT NULL,
"MLeaseId" varchar(45) NOT NULL,
"ExtId" integer unsigned NOT NULL,
"MPlotNo" character varying(45) NOT NULL,
"DPlotNo" character varying(45) NOT NULL,
"SheetNo" character varying(45) NOT NULL,
"NastiNo" character varying(45) NOT NULL,
"Date" date NOT NULL,
"LHolderName" character varying(45) NOT NULL,
"PhoneNo" character varying(45) DEFAULT NULL,
"TotArea" double NOT NULL,
"LeaseDuration" float NOT NULL,
"UseTypeId" int(6) NOT NULL,
"LFromDate" date NOT NULL,
"LToDate" date NOT NULL,
"OrderDtl" text,
"Remark" text,
"Address" character varying(300) NOT NULL,
PRIMARY KEY (MLeaseId)
)