I need and one ore more SQL query to clean some data in the following way:
1. If the BBSctr field is empty insert the most frequently used BBSctr corresponding to the SpnsrSctr of that record by that Spnsr. Note that different Spnsr may have different "most frequent" BBSctr associations.
2. When there is neither a SpnsrSctr or BBSctr search for any BBSctr association of CnsTckr and assign the most frequent there.
You may not use temporary tables but you can create explicit mapping tables. Execution speed is important but not my primary concern at this time.
Sample data is provided attached.
freelancer 16 คน กำลังเสนอราคาเฉลี่ยที่ $72 สำหรับงานนี้
Hi there, this is pretty straight-forward 2-loop logic. Give me few hours, i will send this to you by morning then you can see result and decide if it meets ur needs. thanks, - Vishal
because I'm an Etl developer and get to see these kind off scenarios daily .Moreover the most important part is tuning,so I can get you the most fine tuned query.