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 / john bershan
@ mkumar.it
the query which you have posted will work if the amount
value is greater than zero and will not work in the case
when the vale s zero as it will throw divisor is equal to
zero.please check it.
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
how would concatenate strings in mysql? : Sql dba
First round ------------------- - Procedure - Packages - Views - Virtual tables - Can we use dcl with in function? - Joins and few scenarios - Triggers and its type - Pragma, type and its functionality - How to create db link in oracle - Materialized view - How to find duplicate values from table? - Cursor and its functionality - Write a script to display friday and its date from a entire year. - Exception Handling Second round ------------------------ Gave a scenario like. Need to write a function to perform. When user try to change a password. It must not be last five password and a given password can be combination of characters, symbols, upper and lower case.
What are the different dcl commands in sql?
How to get list of all tables from a database?
Write a query to display the current date in sql?
What is trigger in pl sql?
How we can create a table in pl/sql block. Insert records into it? Is it possible by some procedure or function? Please give example?
What is dml statement?
How can we link a sql database to an existing android app?
what is csv? : Sql dba
How to know the last executed procedure?
Does a primary key have to be a number?
How can I see all tables in sql?
What is varchar example?
What is the unique index?