sqldatabasetime-seriesdolphindb

How to select count distinct in DolphinDB?


I would like to execute the following SQL query in DolphinDB.

select count(distinct symbol) from loadTable("dfs://share","stock1")

It throws an exception Can't call an aggregated function in the argument of another aggregated function call.

Is my query wrong?


Solution

  • you can try like below using subquery

     select count(*) from (
     select distinct symbol from loadTable("dfs://share","stock1")
      ) a