主题:請問哪個SQL語句快些?
1.(含子查詢)
update #a set
qty=(select sum(s_qty-(select sum(t_qty) from ** where **)) from ** where **)
2.(折分子查詢)
update #a set
qty1=(select sum(s_qty) from ** where **)
qty2=(select sum(t_qty) from ** where ***)
update #a set
qty=qty1-qty2
請問哪個SQL語句快些?(不考慮索引等因素,只考慮SQL寫法)
update #a set
qty=(select sum(s_qty-(select sum(t_qty) from ** where **)) from ** where **)
2.(折分子查詢)
update #a set
qty1=(select sum(s_qty) from ** where **)
qty2=(select sum(t_qty) from ** where ***)
update #a set
qty=qty1-qty2
請問哪個SQL語句快些?(不考慮索引等因素,只考慮SQL寫法)