Skip to content

Commit ca5c553

Browse files
feat: syntax sugar
Signed-off-by: Andreas Reichel <andreas@manticore-projects.com>
1 parent df51933 commit ca5c553

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

src/main/java/net/sf/jsqlparser/statement/select/LateralSubSelect.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
*/
1010
package net.sf.jsqlparser.statement.select;
1111

12+
import net.sf.jsqlparser.expression.Alias;
13+
1214
/**
1315
* lateral sub select
1416
*
@@ -22,7 +24,21 @@ public LateralSubSelect() {
2224
}
2325

2426
public LateralSubSelect(String prefix) {
27+
this(prefix, null, null);
28+
}
29+
30+
public LateralSubSelect(String prefix, Select select) {
31+
this(prefix, select, null);
32+
}
33+
34+
public LateralSubSelect(Select select, Alias alias) {
35+
this("LATERAL", select, alias);
36+
}
37+
38+
public LateralSubSelect(String prefix, Select select, Alias alias) {
2539
this.prefix = prefix;
40+
this.select = select;
41+
this.alias = alias;
2642
}
2743

2844
public String getPrefix() {
@@ -43,6 +59,11 @@ public LateralSubSelect withSelect(Select select) {
4359
return this;
4460
}
4561

62+
public LateralSubSelect withAlias(Alias alias) {
63+
setAlias(alias);
64+
return this;
65+
}
66+
4667
public String toString() {
4768
return prefix + super.toString();
4869
}

0 commit comments

Comments
 (0)