new String[] { "time_by_day", "time_by_day", "product_class" },
new String[] { "the_year", "quarter", "product_family" },
new String[] { "1997", "Q1", "Food" });
SqlPattern[] patterns = {
new SqlPattern(
Dialect.DatabaseProduct.MYSQL,
"select"
+ " `time_by_day`.`the_year` as `c0`,"
+ " `time_by_day`.`quarter` as `c1`,"
+ " `product_class`.`product_family` as `c2`,"
+ " count(distinct `sales_fact_1997`.`customer_id`) as `m0` "
+ "from `time_by_day` as `time_by_day`,"
+ " `sales_fact_1997` as `sales_fact_1997`,"
+ " `product_class` as `product_class`,"
+ " `product` as `product` "
+ "where `sales_fact_1997`.`time_id` = `time_by_day`.`time_id`"
+ " and `time_by_day`.`the_year` = 1997"
+ " and `time_by_day`.`quarter` = `Q1`"
+ " and `sales_fact_1997`.`product_id` = `product`.`product_id`"
+ " and `product`.`product_class_id` = `product_class`.`product_class_id`"
+ " and `product_class`.`product_family` = `Food` "
+ "group by `time_by_day`.`the_year`,"
+ " `time_by_day`.`quarter`,"
+ " `product_class`.`product_family`",
23),
new SqlPattern(
Dialect.DatabaseProduct.ACCESS,
"select"
+ " `d0` as `c0`,"
+ " `d1` as `c1`,"
+ " `d2` as `c2`,"
+ " count(`m0`) as `c3` "
+ "from ("
+ "select distinct `time_by_day`.`the_year` as `d0`,"
+ " `time_by_day`.`quarter` as `d1`,"
+ " `product_class`.`product_family` as `d2`,"
+ " `sales_fact_1997`.`customer_id` as `m0` "
+ "from `time_by_day` as `time_by_day`,"
+ " `sales_fact_1997` as `sales_fact_1997`,"
+ " `product_class` as `product_class`,"
+ " `product` as `product` "
+ "where `sales_fact_1997`.`time_id` = `time_by_day`.`time_id`"
+ " and `time_by_day`.`the_year` = 1997"
+ " and `time_by_day`.`quarter` = 'Q1'"
+ " and `sales_fact_1997`.`product_id` = `product`.`product_id`"
+ " and `product`.`product_class_id` = `product_class`.`product_class_id`"
+ " and `product_class`.`product_family` = 'Food') as `dummyname` "
+ "group by `d0`, `d1`, `d2`",
23),
new SqlPattern(
Dialect.DatabaseProduct.DERBY,
"select "
+ "\"time_by_day\".\"the_year\" as \"c0\", \"time_by_day\".\"quarter\" as \"c1\", "
+ "\"product_class\".\"product_family\" as \"c2\", "
+ "count(distinct \"sales_fact_1997\".\"customer_id\") as \"m0\" "