I have a ...CTE... that returns the following table:...m_ids |gp_id |id |m_id |id |type|id |type|qty|...
------|------|---|-----|---|----|---|----|---|---
...Columns ...m_ids..., ...gp_id... and ...m_id... were used for join and have to be removed. The da...