SELECT CREATOR,COUNT(*)
FROM SYSIBM.SYSTABLES
GROUP BY CREATOR
ORDER BY 2 DESC
The GROUP BY clause will sort the data in order to perform an aggregation, but you don't have to keep the data in that order. So the above query will give a list of table creators but ordered by the number of tables each has in descending order.
DB2 Guy" wrote: ↑Mon Apr 22, 2024 9:34 pm
This might interest some of you. Listed below are the Mainframe Interview Questions for 3-5 Years Experience:Database and SQL
Describe different transaction isolation levels in DB2 and their implications.
What SQL statements have you used extensively during development and support?
Explain the effects of using CURSOR WITH HOLD with GROUP BY and ORDER BY clauses in your queries.
How do you retrieve the current system date and time using DB2 and COBOL?
JCL and Data Management
Describe a situation where you encountered a JCL error code -904. What was the cause and how did you resolve it?
How can you check for empty files and locate specific characters within files using JCL utilities?
How do you reference the output dataset from a previous step in a JCL job with multiple steps?
Explain the purpose and usage of COND=EVEN and COND=ONLY parameters in JCL.
How do you manage the deletion of a GDG (Generation Data Group)?
COBOL Programming
Explain how to declare and use host variables in COBOL programs.
How can data be passed from a JCL job to a COBOL program?
What happens when you encounter a SUM FIELDS = NONE condition in COBOL?
Describe the compilation process for COBOL programs that interact with a DB2 database.
All the best,
Can someone please answer all the questions, this would help.