dotnetrockz Posted September 8, 2014 Author Report Posted September 8, 2014 count(*) doesnt work either
ParmQ Posted September 8, 2014 Report Posted September 8, 2014 You are using it in aggregate function kadha? Using it in the aggregate function and using the same in the group by may not work.
Silver_mani Posted September 8, 2014 Report Posted September 8, 2014 Baa, use partition by clause over Rank or row number. Row no assign chesina kuda you have to group again on ur keys and Do the sum of the row no
kranthi111 Posted September 8, 2014 Report Posted September 8, 2014 select transactiondate,max(category),count(category) from #temp group by transactiondate,category idhi try chey
ParmQ Posted September 8, 2014 Report Posted September 8, 2014 Row no assign chesina kuda you have to group again on ur keys and Do the sum of the row no Yes, just partition by will not work.
ParmQ Posted September 8, 2014 Report Posted September 8, 2014 select transactiondate,max(category),count(category) from #temp group by transactiondate idhi try chey Adhi ela? you are not inserting anything into temp table. And you are not reading from an actual table.
kranthi111 Posted September 8, 2014 Report Posted September 8, 2014 Adhi ela? you are not inserting anything into temp table. And you are not reading from an actual table. nenu sample ga rasanu script na DB lo.. temp table is main table akkada
Silver_mani Posted September 8, 2014 Report Posted September 8, 2014 count(*) doesnt work either nenu check chesa mama ...it should work ...whats ur query ??
ParmQ Posted September 8, 2014 Report Posted September 8, 2014 nenu sample ga rasanu script na DB lo.. temp table is main table akkada Got it.
ParmQ Posted September 8, 2014 Report Posted September 8, 2014 Final ga try this. SELECT transactiondate, Category, COUNT(*) as count FROM Table GROUP BY transactiondate, Category HAVING COUNT(*) > 1 ORDER BY COUNT(*) DESC
pythonic Posted September 8, 2014 Report Posted September 8, 2014 count(*) doesnt work either intaki em db uncle....Oracle lo ayithe should work....is it mysql or sqlserver?
quintin Posted September 8, 2014 Report Posted September 8, 2014 Bhaya china example hope this will work Select a,b,c , d as count from (table name) group by a,b,c having count(*) > 1
dkchinnari Posted September 8, 2014 Report Posted September 8, 2014 nenu check chesa mama ...it should work ...whats ur query ?? pls stop coming to DB..thanks for ur support and understanding...
quintin Posted September 8, 2014 Report Posted September 8, 2014 Final ga try this. SELECT transactiondate, Category COUNT(*) count FROM Table GROUP BY transactiondate, Category HAVING COUNT(*) > 1 ORDER BY COUNT(*) DESC correct
Silver_mani Posted September 8, 2014 Report Posted September 8, 2014 Bhaya china example hope this will work Select a,b,c , d as count from (table name) group by a,b,c having count(*) > 1 this is basically to check the no of duplicates on Keys .
Recommended Posts