db2 query
I have one table with the following details.
SNO SNAME DOJ
------ -------------------- ----------
10 KRISH 2007-03-19
20 REDDY 2007-05-19
30 RRRRR 2007-05-19
40 BBBBB 2008-05-19
50 CCCCC 2009-05-19
60 JJJJJ 2009-05-19
70 JJJJJ 2004-05-19
i want the output in the following format:( no of students
joined in each year(no nedd to consider about month and
date)
year count
--------- ----------
2004 1
2007 3
2008 1
2009 2
Answer Posted / rama krishna reddy
Hi Amita,
i already tried with the query that you mentioned..
it will work in oracle...but it will not work in db2..
db2 doesn't allow any function like year(),month(),substr
()...in group by clause...
| Is This Answer Correct ? | 1 Yes | 2 No |
Post New Answer View All Answers
have 3 tables table1, table2 and table3 which contains employee information. table1 is master table, table2 contains emp details like emp no and so on, table 3 contains emp salary. so if any emp leave company between 25th - 30th of every month it has to get updated in tables. but it is not getting updated. What is the reason.
What are the two types of logging in the db2 database? Explain them.
What is dclgen (declaration generator)?
What is host variable in db2 cobol?
How to access db2 tables in mainframe?
How can deadlocks be resolved?
What is the physical storage length of timestamp data type?
How do you find the maximum value in a column in db2?
What is a db2 schema?
Define check constraint.
What is db2 optimizer?
What is coalesce in db2?
What is the connection string to connect to the DB2 Database ?
In case if at some point of time db2 is down, would that impact the pre-compilation process of a db2-cobol program?
Explain various types of locks in db2?