Click here to Skip to main content
15,921,941 members
Home / Discussions / Database
   

Database

 
QuestionUpdate transaction makes no changes to database Pin
Nigel Mackay5-Jul-08 20:52
Nigel Mackay5-Jul-08 20:52 
QuestionOracle InstantClient Pin
Muammar©5-Jul-08 19:41
Muammar©5-Jul-08 19:41 
QuestionSQL Server 2005 and vb.net >>>> Connection String Pin
kindman_nb5-Jul-08 12:37
kindman_nb5-Jul-08 12:37 
AnswerRe: SQL Server 2005 and vb.net >>>> Connection String Pin
N a v a n e e t h5-Jul-08 16:44
N a v a n e e t h5-Jul-08 16:44 
QuestionApostrophe In Field-Value Problem Pin
xbiplav5-Jul-08 10:57
xbiplav5-Jul-08 10:57 
AnswerRe: Apostrophe In Field-Value Problem Pin
Kjetil Svendsen6-Jul-08 22:35
Kjetil Svendsen6-Jul-08 22:35 
QuestionNeed tips for designing Database for multilingual websites (6 different languages) Pin
amistry_petlad5-Jul-08 4:46
amistry_petlad5-Jul-08 4:46 
Questionselect problem Pin
Stephan Hoppe4-Jul-08 12:24
Stephan Hoppe4-Jul-08 12:24 
Hi guys,

I am trying to figure out how to solve this simple select statement, but somehow I am unable to get it all together. I simplified my problem which is like this. I have a unlimited number of persons and teams. Each person can be a member of one or more teams. I would like to figure out which person is a member of all teams. To make it easier for you to follow here is a SQL snippet to create sample tables and data

create table #person
(
	PersonId varchar(2),
	Firstname nvarchar(50)
)

create table #member
(
	PersonId varchar(2),
	TeamId varchar(2)
)

create table #team
(
	TeamId varchar(2),
	TeamName nvarchar(50)
)


insert into #person values ('P1', 'Wayne');
insert into #person values ('P2', 'Rick');
insert into #person values ('P3', 'Bob');

insert into #team values ('T1', 'Team 1');
insert into #team values ('T2', 'Team 2');
insert into #team values ('T3', 'Team 3');


insert into #member values ('P1', 'T1');
insert into #member values ('P2', 'T1');
insert into #member values ('P2', 'T2');
insert into #member values ('P2', 'T3');
insert into #member values ('P3', 'T3');

drop table #member
drop table #person
drop table #team


The only person in all teams is Rick.

Thanks for any kind of help on this matter.


Cheers!
Byteloser

P.S: By the way I am using SQL Server 2005
AnswerRe: select problem Pin
leoinfo4-Jul-08 14:59
leoinfo4-Jul-08 14:59 
GeneralRe: select problem Pin
Stephan Hoppe5-Jul-08 6:13
Stephan Hoppe5-Jul-08 6:13 
QuestionHow to get date only from the table Pin
BalasubramanianK4-Jul-08 3:20
BalasubramanianK4-Jul-08 3:20 
AnswerRe: How to get date only from the table Pin
leoinfo4-Jul-08 3:50
leoinfo4-Jul-08 3:50 
QuestionTrouble joining between 3 tables Pin
dlarkin773-Jul-08 10:14
dlarkin773-Jul-08 10:14 
AnswerRe: Trouble joining between 3 tables Pin
Paul Conrad3-Jul-08 11:15
professionalPaul Conrad3-Jul-08 11:15 
AnswerRe: Trouble joining between 3 tables Pin
Blue_Boy3-Jul-08 22:39
Blue_Boy3-Jul-08 22:39 
QuestionRTF in Reporting services reports Pin
AlterD3-Jul-08 9:14
AlterD3-Jul-08 9:14 
QuestionHelp in get Time Pin
Senthil S3-Jul-08 4:08
Senthil S3-Jul-08 4:08 
AnswerRe: Help in get Time Pin
DerekFL3-Jul-08 4:39
DerekFL3-Jul-08 4:39 
AnswerRe: Help in get Time Pin
Blue_Boy3-Jul-08 22:43
Blue_Boy3-Jul-08 22:43 
Questiontrigger instead of identity Pin
Mr.Kode3-Jul-08 1:04
Mr.Kode3-Jul-08 1:04 
AnswerRe: trigger instead of identity Pin
DerekFL3-Jul-08 4:43
DerekFL3-Jul-08 4:43 
AnswerRe: trigger instead of identity Pin
DerekFL3-Jul-08 4:55
DerekFL3-Jul-08 4:55 
AnswerRe: trigger instead of identity Pin
leoinfo4-Jul-08 4:26
leoinfo4-Jul-08 4:26 
Questionbegin tran... commit and stored procedures/functions Pin
blakey4043-Jul-08 0:21
blakey4043-Jul-08 0:21 
AnswerRe: begin tran... commit and stored procedures/functions Pin
DerekFL3-Jul-08 4:52
DerekFL3-Jul-08 4:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.