با سلام دوستان گرامی کسی میتونه لطف کنه روشی برای بهینه کردن این کوئری ارائه کنه
تا سرعت اجراش بیشتر بشه
select f1,select sum(sf_count) from tbl_fact_1401 left join tbl_sub_fact_1401 on
tbl_fact_1401.f_id = tbl_sub_fact_1401.sf_f_id
where tbl_sub_fact_1401.sf_o_code = 3 and tbl_sub_fact_1401.sf_detail like
'%' + f1+ ' /' + '%' + f1 and f_del = 0 and f_sales = 1 and
f_date between '1401/10/17' and '1401/10/17'
این کوئری در یک select تو در تو اجرا میشه