Expression must be a group key or aggregate:

I have getting this error “Expression must be a group key or aggregate: (t.aadharNo)”,
“query_from_user”: “select t.aadharNo as ad,count(t)as count from tablet where t.title=‘users’ LIMIT 5”

here is my query,is there any wrong?
"select t.aadharNo as ad,count(t)as count from table t where t.title=‘users’ LIMIT 5’;

Example document:

{
“id”: “123456gg55d”,
“Name”: “Jane”,
“aadharNo”: “12344534566”,
“age”: “26”,
}

The error is right. If query contains group by or aggregates you can only project group columns and aggregates.
In this case you don’t have group by you can only project aggregates.

SELECT  t.aadharNo AS ad, COUNT(1 ) AS  cnt FROM table t 
WHERE t.title=‘users’  GROUP BY  t.aadharNo LIMIT 5;

OR

SELECT  COUNT(1 ) AS  cnt FROM table t 
WHERE t.title=‘users’  ;

okay thank you…it works :+1: