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.

Answer Posted / prativa mishra

select
trans_id,debit_credit_indicator,max(trans_amount),min(trans_am
ount) from customer1
group by trans_id,debit_credit_indicator
order by trans_id

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what are the different index configurations a table can have? : Sql dba

576


Any attempt to navigate programmatically to disabled form in a call_form stack is allowed?

581


State few characteristics of pl/sql?

569


How do you rename a table in sql?

534


Is trigger a stored procedure?

509






Why is pl sql needed?

517


What are expressions?

564


How can I delete duplicate rows?

565


What is sharding in sql?

566


How do I find sql profiler?

521


how to add a new column to an existing table in mysql? : Sql dba

587


How do you remove duplicate records from a table?

511


Is grant a ddl statement?

453


What is a pdo connection?

519


How do I view a view in sql?

510