I have the following query that inserts data into table.
INSERT INTO linking (user, relaterd, type, changedate, changeuser, createdate, muser, id, common)
SELECT map.user, mre.uuid, 'BALL', TIMESTAMP '2019-11-03 00:00:00.000', 'system', TIMESTAMP '2019-11-03 00:00:00.000', 'system', uuid_generate_v4(), mre.uuid
FROM (SELECT user FROM mapuser v JOIN mct m ON v.uid = m.groep) map
JOIN (SELECT mr.uuid, mr.number FROM mre mr where mr.type = 'KCT') mre ON mre.number = substring(m.groep, 2, length(m.groep));
I want the columns "user", "relaterd" and "common" to be filled by the SELECT-JOIN statements. The columns "relaterd"
and "common" have the same values. The other columns are constants.
When I execute this query, I get the ERROR MESSAGE :: missing FROM-clause entry for table "m". It's like it wants me to use From clause for the table "mct" which I think I don't need it because am JOINING it with mapuser table.