프로필 사진
마포돌주먹
bolt icon236·약 1년·
517
·수정됨
공유

sql 쿼리 질문있습니다!!

SELECT
revenue, grossProfit, operatingIncomeLoss, profitLoss, comprehensiveIncome,
assets, liabilities, equity, cashFlowsFromUsedInOperatingActivities, cashFlowsFromUsedInInvestingActivities,
cashFlowsFromUsedInFinancingActivities, increaseDecreaseInCashAndCashEquivalents, currentAssets, currentLiabilities, costOfSales,
shortTermTradeReceivable, inventories, propertyPlantAndEquipment, revenueCumulativeAmount, grossProfitCumulativeAmount,
operatingIncomeLossCumulativeAmount, profitLossCumulativeAmount, comprehensiveIncomeCumulativeAmount,
,'035720'
'2021'
'CFS'
'11013'
FROM tb_web_financial_statement T1
INNER JOIN
(
SELECT
t3.ISU_SRT_CD, t2.CORP_CODE
FROM tb_stock_list t3
,tb_corpcode t2
WHERE t3.ISU_SRT_CD = t2.STOCK_CODE
AND t3.ISU_SRT_CD = '035720'
AND t3.DELETE_YN = 'N'
) T2
ON T1.CORP_CODE = T2.CORP_CODE
AND T1.BSNS_YEAR = '2020'
AND T1.FS_DIV = 'CFS'
AND T1.REPRT_CODE = '11013';

이 결과 값이랑

SELECT STOCK_CODE AS stockCode,
CORP_CODE AS corpCode,
BSNS_YEAR AS bsnsYear,
REPRT_CODE AS reprtCode,
RCEPT_NO AS rceptNo,
CORP_CLS AS corpCls,
CORP_CODE AS corpCode,
CORP_NAME AS corpName,
SE AS se,
NMPR AS nmpr,
FYER_SALARY_TOTAMT AS fyerSalaryTotamt,
JAN_SALARY_AM AS janSalaryAm,
RM AS rm
FROM TB_UNREGISTERED_EXECUTIVE

이거 결과 값이랑 합치고 싶은데 컬럼 값도 다 다르고 갯수도 다릅니다.

UNION UNION ALL LEFT 조인 RIGHT 조인 써봤는데 안 되네요 참고로 마리아 db입니다


-1
cat-footer