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 2000 Forums
 SQL Server Development (2000)
 Another SQL query required

Author  Topic 

vijmeena
Starting Member

10 Posts

Posted - 2003-01-03 : 00:52:50
I have 2 tables with the following data.

Table 1
Flag
N
Y
N

Table 2
Flag
Y
Y
N

If I group by the field flag for both the tables separately I get the results as

N 2
Y 1 for table 1

and

Y 2
N 1 form table 2

How can I write a single query to get the results as
Y 3
N 3

There are other columns also present in the 2 tables.

byrmol
Shed Building SQL Farmer

1591 Posts

Posted - 2003-01-03 : 03:31:07
Look up "UNION" in Books on Line (BOL)

DavidM

"SQL-3 is an abomination.."
Go to Top of Page
   

- Advertisement -