IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Count of customer id from two tables


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
bhaskar_kanteti

Active User


Joined: 01 Feb 2007
Posts: 123
Location: Hyderabad

PostPosted: Tue Oct 30, 2007 11:53 am
Reply with quote

Hi,

I want the total count of customer id from two table.
ie. If in my first table i had 5 customer id of 10000 and 3 customer id of 10000 in my second table. then the total count should be 8.
How can i get this.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Oct 30, 2007 7:28 pm
Reply with quote

Hello,

You might use:
Select count(*) from tab1 where custid = 10000
Select count(*) from tab2 where custid = 10000
Add the counts giving total for custid 10000
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts To get the count of rows for every 1 ... DB2 3
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Validating record count of a file is ... DFSORT/ICETOOL 13
No new posts Insert header record with record coun... DFSORT/ICETOOL 14
No new posts Need to fetch data from so many DB2 t... DB2 9
Search our Forums:

Back to Top