[BO] 임가현황 리스트, 상세 작업 중 (1)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
-- DROP VIEW
|
||||
DROP VIEW v_uicode_view_name;
|
||||
DROP VIEW v_household_with_code;
|
||||
DROP VIEW v_household_researcher;
|
||||
|
||||
|
||||
-- CREATE VIEW
|
||||
@@ -24,7 +25,10 @@ SELECT
|
||||
h.seq,
|
||||
h.household_num,
|
||||
h.owner_name,
|
||||
h.owner_age,
|
||||
h.tel,
|
||||
h.phone,
|
||||
h.address,
|
||||
h.region_main_code,
|
||||
main.code_text AS region_main_name,
|
||||
h.region_sub_code,
|
||||
@@ -34,13 +38,18 @@ SELECT
|
||||
h.industry_large_code,
|
||||
ind_large.name AS industry_large_name,
|
||||
h.industry_middle_code,
|
||||
ind_middle.name AS industry_middle_name
|
||||
ind_middle.name AS industry_middle_name,
|
||||
h.industry_sub_middle,
|
||||
h.industry_detail,
|
||||
h.is_panel,
|
||||
h.memo
|
||||
FROM household h
|
||||
LEFT JOIN uicode main ON h.region_main_code = main.id
|
||||
LEFT JOIN uicode main ON h.region_main_code = main.id
|
||||
LEFT JOIN v_uicode_view_name sub ON h.region_sub_code = sub.id
|
||||
LEFT JOIN v_uicode_view_name detail ON h.region_detail_code = detail.id
|
||||
LEFT JOIN v_uicode_view_name ind_large ON h.industry_large_code = ind_large.id
|
||||
LEFT JOIN v_uicode_view_name ind_middle ON h.industry_middle_code = ind_middle.id;
|
||||
LEFT JOIN v_uicode_view_name ind_middle ON h.industry_middle_code = ind_middle.id
|
||||
WHERE h.is_deleted = false;
|
||||
|
||||
|
||||
-- ============================================
|
||||
|
||||
Reference in New Issue
Block a user