Silver_mani 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 small change 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 intaki em db uncle....Oracle lo ayithe should work....is it mysql or sqlserver? even mysql and sqlserver should work.... "count(*) as count" ani add cheyi SELECT TRANSACTIONDATE, CATEGORY, COUNT(*) as count FROM TABLE GROUP BY TRANSACTIONDATE, CATEGORY
Silver_mani Posted September 8, 2014 Report Posted September 8, 2014 pls stop coming to DB..thanks for ur support and understanding... work aitadi vayya
dkchinnari Posted September 8, 2014 Report Posted September 8, 2014 work aitadi vayya nee db future dpends on nissan :3D_Smiles_38: :3D_Smiles_38:
ParmQ Posted September 8, 2014 Report Posted September 8, 2014 pls stop coming to DB..thanks for ur support and understanding... uncle already promised earlier also. Nandita and Alia Bhatt ki voting petti, Alia ki okka vote ekkuva vacchina...DB ki raanu ani sapadham chesadu. @3$% @3$%
Silver_mani Posted September 8, 2014 Report Posted September 8, 2014 nee db future dpends on nissan Manodu ekkado tappu chesadu Query lo ...
dotnetrockz Posted September 8, 2014 Author Report Posted September 8, 2014 ur query's are working fine for that data... may be issue is with my data retrieval rather than group by...thanks everyone who took time to reply
Silver_mani Posted September 8, 2014 Report Posted September 8, 2014 uncle already promised earlier also. Nandita and Alia Bhatt ki voting petti, Alia ki okka vote ekkuva vacchina...DB ki raanu ani sapadham chesadu. @3$% @3$% kompadeesi nuvvu gani Alia ki vote vesava mama ??
ParmQ Posted September 8, 2014 Report Posted September 8, 2014 kompadeesi nuvvu gani Alia ki vote vesava mama ?? Nenu okkadine kaadhu vuncle, DB mottham vesendhi.
Silver_mani Posted September 8, 2014 Report Posted September 8, 2014 Nenu okkadine kaadhu vuncle, DB mottham vesendhi. Nanditha ne win ayyinidi man
dotnetrockz Posted September 8, 2014 Author Report Posted September 8, 2014 ok query is finally working........issue enti ante nenu datecolumn ni convert chesinappudu alias peru orginal column peru icha..adn the same coulmn name iam giving in group by clause ...akkada dengindhi
dotnetrockz Posted September 8, 2014 Author Report Posted September 8, 2014 for future reference example declare @table1 table ( tdate varchar(20), category varchar(20) ) insert into @table1(tdate,category) values ('08/15/2014','economy') insert into @table1(tdate,category) values ('08/16/2014','bussiness') insert into @table1(tdate,category) values ('08/15/2014','bussiness') insert into @table1(tdate,category) values ('08/17/2014','compact') insert into @table1(tdate,category) values ('08/16/2014','bussiness') insert into @table1(tdate,category) values ('08/15/2014','economy') SELECT tdate, category, COUNT(*) FROM @table1 GROUP BY tdate, category --HAVING COUNT(*) > 1 ORDER BY tdate
Silver_mani Posted September 8, 2014 Report Posted September 8, 2014 ok query is finally working........issue enti ante nenu datecolumn ni convert chesinappudu alias peru orginal column peru icha..adn the same coulmn name iam giving in group by clause ...akkada dengindhi calling Sardarr
ParmQ Posted September 8, 2014 Report Posted September 8, 2014 Nanditha ne win ayyinidi man Neevu mari comedy vuncle, 1st vote nundi last vote varaku, Alia leading. Neevu madhyalo thread nundi jump.
quintin Posted September 8, 2014 Report Posted September 8, 2014 this is basically to check the no of duplicates on Keys . ya it should return number of times a record is repeatin
Recommended Posts