I am new to SQL and learning some basic things with Treasure Data. I have many records of reservation in a table with 11 distinct resource values that users can reserve.
This gives me the resources in a table:
SELECT
DISTINCT resource
FROM
reservation
;
But what if I just want the output to be the number of records that get returned by the query (i.e., "11").
This doesn't work:
SELECT
COUNT(*) DISTINCT resource
FROM
reservation
;
What is the right syntax for this? I have not been able to figure this out.