Hi,
I am trying to create a table where one of the fields gets the results from another table,
the table I need to get the field from was created like this:
CREATE TABLE "companies" (
"compid" serial,
"compname" character varying(100) NOT NULL,
"compadd1" character varying(100),
"compadd2" character varying(100),
"compcity" character varying(150),
"comppcode" character varying(10),
"compcounty" character varying(20),
"compphone" character varying(15),
"compfax" character varying(15),
"compwebsite" character varying(50),
"compemail" character varying(50),
"compcontact" character varying(50),
"compdescription" character varying(250),
"comptype" integer NOT NULL,
"complevel" integer NOT NULL
);
and the new table needs to be like this
CREATE TABLE "location" (
"compcity" character varying(150),
"loc_description" character varying(250)
);
where the "compcity" field is the result of "SELECT DISTINCT(compcity) FROM companies;" and update automatically,
I think this may be possible with references but I'm not sure if it is or how to do it.
any help would be much appreciated
regards
Mark Cubitt