I have a dB query where I would like to groupBy() only when conditions are met without using union because of pagination. Unfortunatel
groupBy()
union
pagination