内连接
SELECT l_orderkey, SUM(l_extendedprice * (1 - l_discount)) AS revenue, o_orderdate, o_shippriority
FROM customer, orders, lineitem
WHERE o_custkey = c_custkey
AND l_orderkey = o_orderkey
AND c_mktsegment = ?
AND o_orderdate < ?
AND l_shipdate > ?
GROUP BY l_orderkey, o_orderdate, o_shippriority
ORDER BY revenue DESC, o_orderdate多表名映射
@Target(TYPE)
@Retention(RUNTIME)
public @interface ComplexView {
View[] value();
}
@Target(TYPE)
@Retention(RUNTIME)
@Repeatable(ComplexView.class)
public @interface View {
Class<?> value();
String alias() default "";
ViewType type() default ViewType.TABLE_NAME;
}连接条件映射
最后更新于