Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Query to get Summary

Author  Topic 

khanewal
Starting Member

33 Posts

Posted - 2010-10-01 : 03:36:06
HI Friends,

I have some data

Table – 1
MAIN_ID
1
1520
1521
2
1522
1523
7
1524
8
1525
9
1526
1527
1528


Table – 2
source_id attachment_id
1 1520
1 1521
2 1522
2 1523
7 1524
8 1525
9 1526
9 1527
9 1528


Output Summary Required:

Count(main_ID), Count(Att_ID), Count(Bundle)
14, 9, 5 (Total distinct source_ID with attachment)

Sachin.Nand

2937 Posts

Posted - 2010-10-01 : 04:26:36
Is there a relationship between the 2 tables?

PBUH

Go to Top of Page
   

- Advertisement -