mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
20 lines
612 B
Java
20 lines
612 B
Java
package com.alibaba.druid.bvt.sql;
|
|
|
|
import org.junit.Assert;
|
|
|
|
import com.alibaba.druid.sql.SQLUtils;
|
|
|
|
import junit.framework.TestCase;
|
|
|
|
public class GroupingSetsTest extends TestCase {
|
|
public void test_groupingSets() throws Exception {
|
|
String sql = "SELECT brand, size, sum(sales) FROM items_sold GROUP BY GROUPING SETS ((brand), (size), ());";
|
|
|
|
String result = SQLUtils.format(sql, null);
|
|
|
|
Assert.assertEquals("SELECT brand, size, SUM(sales)"
|
|
+ "\nFROM items_sold"
|
|
+ "\nGROUP BY GROUPING SETS ((brand), (size), ());", result);
|
|
}
|
|
}
|