I am just trying to truncate the first two characters from a varchar field in Subjects.subjectid for the subset of records as specified, but it's not working. I can't spot what's wrong with my code (postgresql):
UPDATE subjects
SET
subjectid = substring(S.subjectid from 2)
FROM
ibg_studies ST,subjects S,dnasample D
WHERE
D.studyindex=ST.studyindex
AND ST.studyabrv='CONGER'
AND D.subjectidkey=S.id
AND D.projectindex IS NULL
Any ideas appreciated.
SELECT S.subjectid FROM ibg_studies ST,subjects S,dnasample D WHERE D.studyindex=ST.studyindex AND ST.studyabrv='CONGER' AND D.subjectidkey=S.id AND D.projectindex IS NULL