rajprakashraj Posted July 29, 2015 Report Posted July 29, 2015 Hi guys,naku oka requirement below is the table 'temp' have 5 records group line_amount desc test1 10 test1 20 test2 30 test3 40 test4 50 now i need sql to get like below format group line_amount desc line(can give any name) test1 10 1 test1 20 2 test2 30 1 test3 40 1 test4 50 1 group base meeda line values reinitialize avvali from 1
loveindia Posted July 29, 2015 Report Posted July 29, 2015 ROW_NUMBER keyword use chey man... its a basic thing so I want you to google it, rather than me giving straight out answer...
rajprakashraj Posted July 29, 2015 Author Report Posted July 29, 2015 ROW_NUMBER keyword use chey man... its a basic thing so I want you to google it, rather than me giving straight out answer... Did you see line number,it needs to reinitialize not running count,i know we can use rownum but it wont reintialize with from 1
CheGuevara Posted July 29, 2015 Report Posted July 29, 2015 loveindia chepinattu row_number function use cheste aipotundi kada...test1 unna vatiki 1,2,3 etc ani vastundi, similarly for other test cases..... edi kakunte naaku nee requ ardamkaledu konchem clear ga explain for the below test data group line_amount desc test1 10 test1 20 test2 30 test3 40 test4 50 test 1 60 test 3 70
loveindia Posted July 29, 2015 Report Posted July 29, 2015 Did you see line number,it needs to reinitialize not running count,i know we can use rownum but it wont reintialize with from 1 row_number is not running count man... it will re-initialize as per your partition man...
loveindia Posted July 29, 2015 Report Posted July 29, 2015 Did you see line number,it needs to reinitialize not running count,i know we can use rownum but it wont reintialize with from 1 ila anukodam loney we don't know anything man...be open for advices any time man...
ilakatamaflia Posted July 29, 2015 Report Posted July 29, 2015 Select ps.coulm1 , ps.column2 , count(column1) as count from table1 Group by column1;
loveindia Posted July 29, 2015 Report Posted July 29, 2015 Select ps.coulm1 , ps.column2 , count(column1) as count from table1 Group by column1; rendu columns non-aggregation lo petti oka column ni group by lo pettav endi man...
compose Posted July 29, 2015 Report Posted July 29, 2015 rendu columns non-aggregation lo petti oka column ni group by lo pettav endi man... adi anthe
compose Posted July 29, 2015 Report Posted July 29, 2015 ee avataram enti compu man...SQL classes when nunchi?
Recommended Posts