-- Version:		2025.7.31  14:52:27
Drop Table T_RULE_SAMPLE@

Create Table T_RULE_SAMPLE(
RuleId		VARCHAR(50)		NOT NULL,
sampleDate		TIMESTAMP		NOT NULL,
tagName		VARCHAR(50),
mode		DECIMAL(5),
flag		DECIMAL(5),
data		DECIMAL(13,3),
datajson		,
CONSTRAINT pk_T_RULE_SAMPLE PRIMARY KEY (RuleId, sampleDate)
)
IN TB8KUSREMS INDEX IN TB8KIDXEMS@
Alter Table T_RULE_SAMPLE ALTER COLUMN mode SET WITH Default 0@
Alter Table T_RULE_SAMPLE ALTER COLUMN flag SET WITH Default 1@

COMMENT ON Table T_RULE_SAMPLE IS '统计数据样本'@

COMMENT ON T_RULE_SAMPLE (RuleId IS '规则id')@
COMMENT ON T_RULE_SAMPLE (sampleDate IS '记录时间')@
COMMENT ON T_RULE_SAMPLE (tagName IS 'TagName')@
COMMENT ON T_RULE_SAMPLE (mode IS '样本类型 0：记录样本值 ，1：具体的数据分布情况')@
COMMENT ON T_RULE_SAMPLE (flag IS '可用标记')@
COMMENT ON T_RULE_SAMPLE (data IS '记录样本值')@
COMMENT ON T_RULE_SAMPLE (datajson IS '具体的数据分布情况，JSON格式（最大1000个值）')@

