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

Which data dictionary views have the information on the triggers that are available in the database?

752


What is the difference between Union and Union all. Which is faster.

844


Why we use stored procedure instead of query?

528


Cite the differences between execution of triggers and stored procedures?

615


What are the possible values for the boolean data field?

516






Which table is left in left join?

516


what is a constraint? : Sql dba

708


how to analyze tables with 'mysqlcheck'? : Sql dba

540


How do I create a memory optimized filegroup?

523


What is replication id?

516


How do you get column names only for a table (sql server)?

663


What is db journal file?

516


how does a local variable is defined using t-sql? : Transact sql

537


What is nested table in pl sql?

548


Is pl sql better than sql?

548