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)
 JOINS

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-09-01 : 13:07:49
John writes "I have 2 tables as follows :-
table1 fields
pgrp char 12
desc char 200
act char 1

this is a list of group codes and their descriptions and a flag indicating where that group is active or not.


table2 fields
pgrp char 12
sgrp char 12

this shows which subgroups belong to which main groups


Given a group code, I would like to return

sgrp from table2 and matching desc from table1 where the corresponding act in table1 = 1

ie subgroup codes and their descriptions where the subgroup is active.

I assume that this can be done with a JOIN

W2K - SP2
SQL7"
   

- Advertisement -