-1
任何人都可以幫助我把這個基於子查詢的查詢轉換成JOIN的嗎?需要幫助將子查詢轉換爲JOIN的
SELECT DISTINCT brm_products_assets_id,
(select brm_products_assets_value from brm_products_assets_values where brm_products_assets_id=a.brm_products_assets_id and brm_products_assets_def_id=1) as prod_asset_name,
(select brm_products_assets_value from brm_products_assets_values where brm_products_assets_id=a.brm_products_assets_id and brm_products_assets_def_id=3) as prod_asset_desc,
(select brm_products_assets_value from brm_products_assets_values where brm_products_assets_id=a.brm_products_assets_id and brm_products_assets_def_id=2) as prod_asset_type,
ifnull((select brm_products_assets_value from brm_products_assets_values where brm_products_assets_id=a.brm_products_assets_id and brm_products_assets_def_id=5),'') as file_order
from brm_products_assets a where last_mnt_option!='d';
該查詢當前需要20多秒才能執行。我嘗試了brm_products_assets_value上的索引,但它沒有幫助。
謝謝!