Distinct Count

(2 posts) (2 voices)

Tags:

  1. Dev, Member

    Hi, I want to know how to count the distinct values of a column.

    Below is the query:

    ```sql
    SELECT 'dbr.parameters.show';
    SELECT 'dbr.search', 1;
    SELECT 'dbr.hidecolumn', 'tenant_key';
    SELECT 'dbr.hidecolumn', 'user_key';
    SELECT 'dbr.hidecolumn', 'id';
    SELECT 'dbr.count.prefix','Pet Name','Total Pets';
    SELECT 'dbr.count', 'Pet Name';

    SELECT
    u.id,
    u.user_key,
    t.tenant_key,
    CONCAT(u.first_name, ' ', u.last_name) AS 'Customer Name',
    p.name AS `Pet Name`,
    u.email AS 'Email',
    u.mobile_number AS 'Phone'

    I want to count the distinct count of the Customer Name column. Please help.

  2. myDBR Team, Key Master

    If you update to the latest build, there is a new command dbr.countd for this.

    --
    myDBR Team


Reply

You must log in to post.