Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

i have a customer table.
trans_id trans_date trans_amt debit_credit_indicator
001 01-JAN-13 1099 cr
001 12-JAN-13 500 db
002 24-FEB-13 400 db
002 23-MAR-13 345 cr
001 18-APR-13 800 cr
002 15-MAR-13 600 db
001 12-FEB-13 200 cr

i want like this output.

trans_id trans_amt debit_credit_indicator

i want get highest credit amount and lowest credit amount
and highest debit amount and lowest debit amount for each
trans_id.

pls give me answer. i want urgent

Answer Posted / vinay

Select distinct trans_id,max(trans_amt) over (partition by
trans_id,debit_credit_indicator ),min(trans_amt) over
(partition by trans_id,debit_credit_indicator
),debit_credit_indicator from Customer

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is sqlca in powerbuilder?

994


How do I create a memory optimized filegroup?

946


What is varchar example?

1013


What is difference between ms sql and mysql?

945


Is microsoft sql free?

1083


What's the difference between a primary key and a clustered index?

976


What are pl/sql cursors?

1037


How do you use join?

921


how to do backup entire database? : Transact sql

1112


What is field delimiter?

1035


What will you get by the cursor attribute sql%notfound?

1041


Are ddl triggers fired for ddl statements within a pl/sql code executed using the dbms.sql package?

1081


Are pl sql variables case sensitive?

1032


How to run sql statements with oracle sql developer?

1048


how to get help information from the server? : Sql dba

919