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 / 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


Please Help Members By Posting Answers For Below Questions

what is 'mysqld'? : Sql dba

969


Can a trigger call a stored procedure?

1070


What are the two types of cursors in pl sql?

1082


explain the difference between bool, tinyint and bit. : Sql dba

999


Why stored procedures are faster than query?

1025


Is ms sql is free?

1020


what are the nonstandard string types? : Sql dba

1138


What is a behavioral trigger?

972


What are literals in sql server?

1170


What is a loop in sql?

984


Explain the commit statement.

1159


what are the maximum number of rows that can be constructed by inserting rows directly in value list? : Transact sql

952


What are the limitations of sql express?

1069


what is the difference between myisam static and myisam dynamic? : Sql dba

1065


How do I run a sql script?

1147