Jump to content

Oracle Sql Help


Recommended Posts

Posted

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

 

 

 

Posted

ROW_NUMBER keyword use chey man... its a basic thing so I want you to google it, rather than me giving straight out answer... mLO5Za.gif

Posted

ROW_NUMBER keyword use chey man... its a basic thing so I want you to google it, rather than me giving straight out answer... mLO5Za.gif

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

Posted

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

Posted

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...mLO5Za.gif

Posted

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...mLO5Za.gif

Posted

Select ps.coulm1 , ps.column2 ,
count(column1) as count from table1
Group by column1;
Posted

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... mLO5Za.gif

Posted

rendu columns non-aggregation lo petti oka column ni group by lo pettav endi man... mLO5Za.gif

adi anthe lol4.gif
Posted

aa laddhi mukku pori gif aapvay ...pls

×
×
  • Create New...