Gorm: Distinct?

Created on 4 Apr 2017  路  1Comment  路  Source: go-gorm/gorm

How do I use distinct?

Most helpful comment

Very badly documented, but after a bit of tinkering I got db.Table("points").Select("DISTINCT(field_name)").Where("created_at >= ?", time.Now().Local().AddDate(0, 0, -1)).Scan(&points) working.

>All comments

Very badly documented, but after a bit of tinkering I got db.Table("points").Select("DISTINCT(field_name)").Where("created_at >= ?", time.Now().Local().AddDate(0, 0, -1)).Scan(&points) working.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

koalacxr picture koalacxr  路  3Comments

superwf picture superwf  路  3Comments

hypertornado picture hypertornado  路  3Comments

Quentin-M picture Quentin-M  路  3Comments

fieryorc picture fieryorc  路  3Comments