table name :Tab
fields name
1.trx_no (pk)
2.trx_date
3.account code (7 char)
4.account type (1 char)
5.amt
Tab contains account code day wise debit and credit transaction , account type fiels can have 2 value D for debit and c for Credit .
write a query to display the account code wise total debit and credit bal for the month of april 2004.
write a query to display account code wise new amt credit for the april 2004
Answers were Sorted based on User's Feedback
Answer / ritika yadav
select account_code,account_type, sum (amt)
from tab
where to_char(trx_date,'DD-MM-YYYY') between '01-04-2014' and '30-04-2014'
group by account_code, account_type
order by account_code, account_type;
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / jayashree
SELECT SUM(DECODE(ACC_CODE, 'C', AMT)) Total_credit_bal,
SUM(DECODE(ACC_CODE, 'D', AMT)) Total_debit_bal
from tab
where to_char(trx_date,'DD-MON-YYYY') between
'01-apr-2014' and '30-apr-2014';
| Is This Answer Correct ? | 1 Yes | 0 No |
mail-id table contains two columns(email_id,userid) it contains different types of mail-ids,and no of users. here username length is differ na,(ex- tamil@yahoo.com,joshua@hotmail.com like) now i want to fetch the email-ids only starting from '@' (ex-@gmail.com,@yahoo.com,@hotmail.com
what are the different functions in sorting an array? : Sql dba
What is memory optimized?
Difference between IN and EXISTS
how i do the database testing of online money transactions between two parties (client and organization). suppose our company makes a website for our client and give a extra feature of online money transaction with there clients then how i test this feature in database testing
If we declare constraints Unique and Not null on a single column then it will act as a Primary key, so what is the use of primary key??
What is the use of function in sql?
Is truncate ddl or dml?
Does truncate remove indexes?
What is graph sql?
What is before trigger?
What is the primary use of normalization?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)