In mainframe DB2, i have two tables TAB 1 and TAB 2. I have records in those tables like:
TAB 1:
AP_NBR LOC_NBR
1000 1
1000 2
1000 3
TAB 2:
LOC_NBR ITM_ID
1 500
1 600
2 450
2 750
Her i need an output like below:
AP_NBR COUNT(LOC_NBR) COUNT(ITM_ID)
1000 3 4
How to write COUNT query for this?
Can anyone please help me on this?
1 Answer