sql: SELECT m_mall_id FROM m_mall INNER JOIN m_mall_info ON m_mall_id = m_minfo_mall_id AND m_minfo_view_flg = 1 AND m_mall_pref_id = m_mall_pref_id AND m_mall_view_flg = 1 AND m_mall_confirm_flg = 1 AND m_mall_app_flg = 1 INNER JOIN t_site_view ON t_sv_mall_id = m_mall_id AND t_sv_site_id = 1 AND t_sv_view_flg = 1 AND CASE WHEN t_sv_site_id = 4 AND m_mall_business_id IN (12,13) THEN m_mall_deli_flg = 1 AND m_minfo_deli_flg = 1 ELSE 1 END INNER JOIN m_pref ON m_pref_id = m_mall_pref_id INNER JOIN m_area ON m_area_id = m_pref_area_id INNER JOIN m_business ON m_business_id = m_mall_business_id INNER JOIN m_s_business ON m_s_business_id = m_business_s_business_id AND m_s_business_id IN (SELECT t_ssb_s_business_id FROM t_site_s_business WHERE t_ssb_site_id = 1) WHERE m_mall_pref_id = PREF_ID AND CASE WHEN m_mall_option_kb = 1 THEN 1 WHEN (m_mall_app_temp_flg = 1 AND (to_days(now()) - to_days(m_mall_app_temp_date) <= 90 OR to_days(now()) < to_days(m_mall_app_temp_date))) THEN 1 ELSE 0 END = 1 AND m_minfo_newsblock_disp = 1 AND m_minfo_view_flg =1 AND m_mall_view_flg =1 AND m_mall_confirm_flg =1 AND m_mall_app_flg = 1
Unknown column 'PREF_ID' in 'where clause'