The query below is a db2 query I have tried to use in mysql. I am getting the error: "Field SSN doesn't exist" when I know that it does. Also if I specify the db and table(i.e. db0.table1.SSN) I get and error saying the table doen't exist. New to mysql/Using MySQLYog client. Anybody know whY?????
SELECT SUBSTRING('000000'||CHAR(SSN) ,5,5)
, STATUS_CODE
, DATE_SEPARATION, CONTR_AT_SEP
, INTEREST_AT_SEP, YTD_REFUNDED_INEST
, REFUND_DATE, MEM_BAL_FWD_CONTRI
, YR_END_ACTUARY_STA
, PREV_INCORRECT_SSN
, DATE_SSN_CORRECTED, DATE_ADDED
, ACTV_DATE, NON_ASM_FLA
, PRIOR_YR_CONTRIB, ATHK_FLAG
, STAR_FLAG, PRE_TAX_CONTR
, 'CNVTD'
, 'CNVTD', DATE_LAST_MAIN
FROM db0.table1
WHERE db0.table1.NAME LIKE 'REFUND%'
AND db0.table1.SSN < 1000
UNION ALL
SELECT SUBSTRING('000000'||CHAR(SSN) ,5,5)
, STATUS_CODE
, DATE_SEPARATION, CONTR_AT_SEP
, INTEREST_AT_SEP, YTD_REFUNDED_INEST
, REFUND_DATE, MEM_BAL_FWD_CONTRI
, YR_END_ACTUARY_STA
, PREV_INCORRECT_SSN
, DATE_SSN_CORRECTED, DATE_ADDED
, ACTV_DATE, NON_ASM_FLA
, PRIOR_YR_CONTRIB, ATHK_FLAG
, STAR_FLAG, PRE_TAX_CONTR
, 'CNVTD'
, 'CNVTD', DATE_LAST_MAIN
FROM db0.table1
WHERE db0.table1.NAME LIKE 'REFUND%'
AND db0.table1.SSN < 1000
UNION ALL