Skip to content
This repository was archived by the owner on Sep 7, 2021. It is now read-only.
This repository is currently being migrated. It's locked while the migration is in progress.

Commit 62d884e

Browse files
dawndiylunny
authored andcommitted
use alias 'as.*' in oracle query with join (#1355)
1 parent f3e6c3a commit 62d884e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

statement.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1157,8 +1157,12 @@ func (statement *Statement) genSelectSQL(columnStr, condSQL string, needLimit, n
11571157
if statement.Start != 0 || statement.LimitN != 0 {
11581158
oldString := buf.String()
11591159
buf.Reset()
1160+
rawColStr := columnStr
1161+
if rawColStr == "*" {
1162+
rawColStr = "at.*"
1163+
}
11601164
fmt.Fprintf(&buf, "SELECT %v FROM (SELECT %v,ROWNUM RN FROM (%v) at WHERE ROWNUM <= %d) aat WHERE RN > %d",
1161-
columnStr, columnStr, oldString, statement.Start+statement.LimitN, statement.Start)
1165+
columnStr, rawColStr, oldString, statement.Start+statement.LimitN, statement.Start)
11621166
}
11631167
}
11641168
}

0 commit comments

Comments
 (0)