DISTINCT
SELECT DISTINCT
is used to select unique values from a set of data. This keyword returns distinct values from the output of the query.
The basic syntax for a SELECT DISTINCT
statement is as followings:
SELECT DISTINCT idc
FROM system_metrics;
SELECT DISTINCT
can be used in conjunction with filters.
SELECT DISTINCT idc, host
FROM system_metrics
WHERE host != 'host2';
SELECT DISTINCT
is a simple but powerful command of GreptimeDB SQL that allows users to easily condense the data into a summary of unique values. It can be used on one column or multiple columns, making it very versatile for data analysis and reporting. Using “SELECT DISTINCT” is a great way to get an overview of the types of data stored in the tables.
当前内容版权归 GreptimeDB 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 GreptimeDB .