Home > Archive > MS SQL Server New Users > October 2005 > SQL statement question









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author SQL statement question
Diane

2005-10-27, 7:55 am

Hello.

Thank you for reading this question.

Any ideas on how to determine if the relationship between two fields in a
table? As 1:1, 1:M or M:M? I'm spinning my wheels on how to get started
with this.

Thank you!
Diane
Kevin3NF

2005-10-27, 7:55 am

2 fields in the same table is 1:1....or did you mean the join fields in two
different tables?

--
Kevin Hill
President
3NF Consulting

www.3nf-inc.com/NewsGroups.htm


"Diane" <someone@example.com> wrote in message
news:3B9BF477-5F48-4924-BABC- BCD110A0D427@microso
ft.com...
> Hello.
>
> Thank you for reading this question.
>
> Any ideas on how to determine if the relationship between two fields in a
> table? As 1:1, 1:M or M:M? I'm spinning my wheels on how to get started
> with this.
>
> Thank you!
> Diane



SQL

2005-10-27, 7:55 am

If I really understood your question correctly then do a self join on
the 2 fields, group them and count them

http://sqlservercode.blogspot.com/

Diane

2005-10-27, 7:55 am

The table is just a dump from another DB that we have no visibility into.
It's kind of like this -

Company Employee
XYZ Sue
BAC Bill
RTY Sue
XYZ Ted
..... ....

I need to group all the companies:employees that are 1:1, 1:M & M:M into
seperate catagories and then get a count of each.

HTH.

Thank you for your help!
Diane


"SQL" wrote:

> If I really understood your question correctly then do a self join on
> the 2 fields, group them and count them
>
> http://sqlservercode.blogspot.com/
>
>

Diane

2005-10-27, 7:55 am

Hi, Kevin.

They are in the same table.
The table is just a dump from another DB that we have no visibility into.
It's kind of like this -

Company Employee
XYZ Sue
BAC Bill
RTY Sue
XYZ Ted
..... ....

I need to group all the companies:employees that are 1:1, 1:M & M:M into
seperate catagories and then get a count of each.

HTH.

Thank you for your help!
Diane


"Kevin3NF" wrote:

> 2 fields in the same table is 1:1....or did you mean the join fields in two
> different tables?
>
> --
> Kevin Hill
> President
> 3NF Consulting
>
> www.3nf-inc.com/NewsGroups.htm
>
>
> "Diane" <someone@example.com> wrote in message
> news:3B9BF477-5F48-4924-BABC- BCD110A0D427@microso
ft.com...
>
>
>

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com