Group Function is not applying on Character Rows

I have data in Oracle table like this format

Gname, PBOOK, CNIC,  LPNAME, ACRE 
Bilal  1234   33202  A            
       1234          A       2    
       1234          A       2    
Adeel  5678   35230  B            
       5678          B       3    
       5678          B       5    

I want to sum up the acre filed and data should look like this

   Gname, PBOOK, CNIC,  LPNAME, SUM(ACRE) 
    Bilal  1234   33202  A       4    
    Adeel  5678   35230  B       8

Plz give any Idea to make such kind of sql statement in oracle so my desired output should be generated

Answers


I'm not sure that I understand you exactly, but you can try:

  SELECT max(Gname), PBOOK, max(CNIC),  LPNAME, SUM(ACRE)
    FROM your_table
GROUP BY PBOOK, LPNAME

Need Your Help

cant connect to Local mongodb server with nodejs

node.js mongodb mongoose

when trying to connect to mongo db from the project directory i get this

Python, Press Any Key To Exit

python python-2.7 key any

So, as the title says, I want a proper code to close my python script.