create table SM_CODE_M (
	L_CODE_ID		varchar(35) not null
,	L_CODE_NM		varchar(50) not null
,	L_CODE_NM_EN	varchar(50)
,	L_CODE_DESC		varchar(500)
,	SORT_SEQ		int
,	USE_YN 			varchar(1)
,	REG_ID			varchar(35)
,	REG_DD			datetime
,	MOD_ID			varchar(35)
,	MOD_DD			datetime 
);

create table SM_CODE_S (
	S_CODE_ID		varchar(35) not null
,	L_CODE_ID		varchar(35) not null
,	S_CODE_NM		varchar(100)
,	S_CODE_NM_EN	varchar(100)
,	S_CODE_DESC		varchar(500)
,	SORT_SEQ		int
,	COLUMN1			varchar(50)
,	COLUMN2			varchar(50)
,	USE_YN 			varchar(1)
,	REG_ID			varchar(35)
,	REG_DD			datetime
,	MOD_ID			varchar(35)
,	MOD_DD			datetime 
);


select * from SM_CODE_M


SELECT B.S_CODE_ID 
	 , B.S_CODE_NM
	 
	 select *
FROM SM_CODE_M A,
SM_CODE_S B 
WHERE A.L_CODE_ID = B.L_CODE_ID 
AND A.USE_YN = 'Y'
AND B.USE_YN = 'Y'
ORDER BY B.SORT_SEQ
