Hello All, Could any well write a query for the following
scenario.

Account(table name)
No Name Amount
1 ABCD 2000.00
2 DEFG -2000.00
3 GHIJ 3000.50
4 JKLM 4000.00
5 MNOP 6000.00

O/p Should be in this format
No Name Credit Debit
1 ABCD 2000.00 0
2 DEFG 0 -2000.00
3 GHIJ 3000.50
4 JKLM 0 -4000.00
5 MNOP 6000.00 o

could any one give appropriate query for this
Thnks in Advance
Suneel Reddy

Answer Posted / suresh kumar somayajula

Select No,Name,to_char(Sal,'$9999.99') amount from emp;

Is This Answer Correct ?    0 Yes 12 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is left join same as inner join?

539


Show code of a cursor for loop.

582


What are pl sql procedures?

516


How to add a column ‘salary’ to a table employee_details?

591


Why left join is used in sql?

518






What is the difference between join and natural join?

473


What is orm in sql?

536


what are the properties and different types of sub-queries? : Sql dba

506


Why do we use joins in sql?

500


how to drop an existing index in mysql? : Sql dba

539


What is normalization in sql?

527


a table has 2 classifications 1)liabilities 2)earnings this liabitity has 2 elements with 2 input values and the earnings have 2 elements with 2 input values i wrote a query so that my input is liability savings amount1 amount2 xxxx null xxxxxx 0 xxx1 null xxxxx1 0 null yyyy 0 yyyy null yyy1 0 yyy1 my problem is --when i developed a report(d2k) with this data my o/p is liabilities,amount1,savings,amount2 xxxx xxxxxx xxx1 xxxxx1 yyyy yyyy yyy1 yyy1 how could i move this savings,savings values 2 palces up. can any body provide me witha better solution

1777


What is pl sql variable?

504


what are the authentication modes in sql server? : Sql dba

529


Explain what is a column in a table?

573