Hello everyone,
I am pretty new to MySQL, and I have been working with some database reports and got stuck.
In attached screenshot, there is part of data I need to work with, so where I am stuck at is:
All of this is one object (work_order_unique_id) each of these objects have blocks (masterdata_id) - for each of those blocks there is multiple reasons why it is rejected or accepted and those have multiple records if their status changed over the time.
So what I need to create and am stuck at is the final status of the object (work_order_unique_id) which will be rejected if there is atleast 1 rejected latest status in any of the blocks (masterdata_id), if all the latest statuses are accepted, the overall status for the object is accepted.
Thank you for any ideas or Idea.
برچسب:
نویسنده: آیلین رضوانی
تاريخ: جمعه
20 بهمن
1396 ساعت: 16:05