Tech Manthan

FAQ and Help Desk

Hi Friends,

You can ask Any Technical Questions here and Give answers to others posted questions but during this make sure that you all keep this place beautiful by not posting any  irrelevant comments or material.

Thanks and Regards

Manthan Team

1 Comment »

  1. Hi Sandeep,

    Irequire your help in the following query as to how to optimize it

    update spool_info set
    weight = (select weight as total_weight from
    (
    SELECT fabshopno,sum(ALLOC_QTY* b.WEIGHT_KG) as weight
    FROM SPOOL_MTO a, WEIGHT_SURF_AREA b
    where a.fabshopno in
    (select fabshopno from spool_mto where material_code ‘PSH20A0D’) and a.MATERIAL_CODE = b.MATCODE and a.SIZE1=b.SIZE1 and a.SIZE2=b.SIZE2 group by a.fabshopno
    ) where fabshopno = spool_info.fabshopno
    )
    where spool_info.fabshopno in
    (select fabshopno from spool_mto where material_code = ‘PSH20A0D’)

    Here if you see the following query is repeated twice:

    (select fabshopno from spool_mto where material_code = ‘PSH20A0D’)

    My question is to how to remove the above query in the nested inner query of weight.

    Comment by Dhaval — September 8, 2007 @ 2:18 pm | Reply


RSS feed for comments on this post. TrackBack URI

Leave a comment

Blog at WordPress.com.