diff --git a/scope.go b/scope.go index 45e197c4..65a438cf 100644 --- a/scope.go +++ b/scope.go @@ -712,6 +712,9 @@ func (scope *Scope) whereSQL() (sql string) { func (scope *Scope) selectSQL() string { if len(scope.Search.selects) == 0 { + if len(scope.Search.joinConditions) > 0 { + return fmt.Sprintf("%v.*", scope.QuotedTableName()) + } return "*" } return scope.buildSelectQuery(scope.Search.selects)