By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
28 rows affected
CONCATENATION |
---|
SELECT X.*,(SELECT KEY_VALUE FROM SAMPLE_DATA Y WHERE Y.PID=X.PID AND Y.RID=X.RID AND Y.KEY_NAME='Age') ,(SELECT KEY_VALUE FROM SAMPLE_DATA Y WHERE Y.PID=X.PID AND Y.RID=X.RID AND Y.KEY_NAME='Gender') ,(SELECT KEY_VALUE FROM SAMPLE_DATA Y WHERE Y.PID=X.PID AND Y.RID=X.RID AND Y.KEY_NAME='Occp') FROM SAMPLES X |