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 / prativa mishra
SELECT trans_id,MAX(TRANS_AMOUNT),MIN(TRANS_AMOUNT),DEBIT_CREDIT_INDICATOR
FROM CUSTOMER
GROUP BY TRANS_ID
,DEBIT_CREDIT_INDICATOR
ORDER BY TRANS_ID
| Is This Answer Correct ? | 8 Yes | 1 No |
Post New Answer View All Answers
How to select 10 records from a table?
what are the types of join and explain each? : Sql dba
What is your daily office routine?
Is pl sql useful?
How to revise and re-run the last sql command?
what are the differences between get and post methods in form submitting. Give the case where we can use get and we can use post methods? : Sql dba
What is a temp table?
Which join is like an inner join?
What is the difference between function and procedure in pl/sql?
How to get list of all tables from a database?
What is an implicit commit?
Why is sql better than hql?
what is a constraint? Tell me about its various levels. : Sql dba
Does sql*plus also have a pl/sql engine?
what is the difference between a having clause and a where clause? : Sql dba