diff --git a/chain.go b/chain.go index 9f05bdc..d5fa2b6 100644 --- a/chain.go +++ b/chain.go @@ -117,10 +117,10 @@ func (this *Query) QueryStmt() error { sql = helper.StringJoin("select ", title) if this.alias != "" { - this.table = helper.StringJoin(table, " as ", this.alias) + table = helper.StringJoin(table, " as ", this.alias) } - sql = helper.StringJoin(sql, " from ", this.table) + sql = helper.StringJoin(sql, " from ", table) if len(this.join) > 0 { for _, joinitem := range this.join {