Distinct returns a derivative query that yields de-duplicated entities with respect to the set of projected fields. It is only used for projection queries. Distinct cannot be used with DistinctOn.
()
| 202 | // respect to the set of projected fields. It is only used for projection |
| 203 | // queries. Distinct cannot be used with DistinctOn. |
| 204 | func (q *Query) Distinct() *Query { |
| 205 | q = q.clone() |
| 206 | q.distinct = true |
| 207 | return q |
| 208 | } |
| 209 | |
| 210 | // DistinctOn returns a derivative query that yields de-duplicated entities with |
| 211 | // respect to the set of the specified fields. It is only used for projection |