Mirror Cluster The mirror function of the virtual cluster has the following characteristics: Flexible mirror configuration: supports mirror setting at the database or table level; Real-time data synchronization: when data changes occur in databases or tables with mirror relationships, the changes are synchronized in real-time on both sides. All tables under mutually mirrored databases will automatically create mirrors. All functions, stored procedures, and views under the database will also be synchronized and created in the target database; High availability: mirror relationships provide more redundant shards for data, resulting in higher availability; disaster recovery: supports cluster deployment in the same city or different locations.
GBase 8a MPP Cluster Technical White Paper General Data Technology Co., Ltd. - 25 - Data Security
可以在使用表达式的任何地方使用数据转换函数。 下列转换函数在日期与字符串之间转换:
DATE 函数 DATE 函数将字符串转换为 DATE 值。 在以下查询中, DATE 函数将字符串转换为 DATE 值, 以允许与 DATETIME 值进行比较。 仅当 call_dtime值比指定的 DATE 晚时查询才会检 索 DATETIME 值。
GBase 8s SQL 指南:教程 南大通用数据技术股份有限公司 - 92 -
图: 查询 SELECT customer_num, call_dtime, res_dtime FROM cust_calls WHERE call_dtime > DATE ('12/31/97'); 图: 查询结果 customer_num call_dtime res_dtime
106 1998-06-12 08:20 1998-06-12 08:25 110 1998-07-07 10:24 1998-07-07 10:30 119 1998-07-01 15:00 1998-07-02 08:21 121 1998-07-10 14:05 1998-07-10 14:06 127 1998-07-31 14:30 仅当 call_dtime 大于或等于指定日期时, 下列查询才会将 DATETIME 值转换为 DATE 格 式并带标签显示这些值。 图: 查询 SELECT customer_num, DATE (call_dtime) called, DATE (res_dtime) resolved FROM cust_calls WHERE call_dtime >= DATE ('1/1/98'); 图: 查询结果 customer_num called resolved
call_descr Order placed one month ago (6/7) not received. 可以使用 DATE 或 TO_DATE 函数来将字符串转换为 DATE 值。 TO_DATE 函数的一个优 点是它允许您为返回的值指定格式。(可以使用 TO_DATE函数(它总是返回 DATETIME 值)来将字符串转换为 DATE 值,原因是数据库服务器隐式处理 DATE 和 DATETIME 值之间的转换。)