Skip to content

Commit 3cc5acd

Browse files
committed
pivot function test
1 parent d4bc726 commit 3cc5acd

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/test/java/net/sf/jsqlparser/test/select/SelectTest.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1484,6 +1484,10 @@ public void testPivotXmlSubquery1() throws JSQLParserException {
14841484
assertSqlCanBeParsedAndDeparsed("SELECT * FROM (SELECT times_purchased, state_code FROM customers t) PIVOT (count(state_code) FOR state_code IN ('NY', 'CT', 'NJ', 'FL', 'MO')) ORDER BY times_purchased");
14851485
}
14861486

1487+
public void testPivotFunction() throws JSQLParserException {
1488+
assertSqlCanBeParsedAndDeparsed("SELECT to_char((SELECT col1 FROM (SELECT times_purchased, state_code FROM customers t) PIVOT (count(state_code) FOR state_code IN ('NY', 'CT', 'NJ', 'FL', 'MO')) ORDER BY times_purchased)) FROM DUAL");
1489+
}
1490+
14871491
public void testRegexpLike1() throws JSQLParserException {
14881492
String stmt = "SELECT * FROM mytable WHERE REGEXP_LIKE(first_name, '^Ste(v|ph)en$')";
14891493
assertSqlCanBeParsedAndDeparsed(stmt);
@@ -1628,15 +1632,15 @@ public void testSelectJoin() throws JSQLParserException {
16281632
+ " WHERE pg_constraint.contype = 'u' AND (pg_attribute.attnum = ANY(pg_constraint.conkey))"
16291633
+ " ORDER BY pg_constraint.conname");
16301634
}
1631-
1635+
16321636
public void testSelectJoin2() throws JSQLParserException {
16331637
assertSqlCanBeParsedAndDeparsed("SELECT * FROM pg_constraint WHERE pg_attribute.attnum = ANY(pg_constraint.conkey)");
16341638
}
1635-
1639+
16361640
public void testSelectOracleColl() throws JSQLParserException {
16371641
assertSqlCanBeParsedAndDeparsed("SELECT * FROM the_table tt WHERE TT.COL1 = lines(idx).COL1");
16381642
}
1639-
1643+
16401644
public void testSelectInnerWith() throws JSQLParserException {
16411645
assertSqlCanBeParsedAndDeparsed("SELECT * FROM (WITH actor AS (SELECT 'a' aid FROM DUAL) SELECT aid FROM actor)");
16421646
}

0 commit comments

Comments
 (0)