Microsoft
Software
Hardware
Network
Question : SQL for binary coupled elements?
I need a query for the many-to-many joined tables, below:
for every element of t in table1,
find every other element t, for which
they both are joined to the same element
q of table 2.
1: 2:
table 1 join table table 2 t i ----> ti ji ----> i q
Answer : SQL for binary coupled elements?
ti - join table, t = element t's id column, q = table q's id column
select C.name, D.name, E.name
from ti A inner join ti B on A.q=B.q and A.t <> B.t
inner join table1 C on C.t=A.t
inner join table1 D on D.t=B.t
inner join table2 E on E.q=B.q
This returns the name of each pair of elements C & D from table1 that are coupled (share the same link to) E
Random Solutions
Riverbed with Cisco GRE Tunnel
windows server 2008 foundation
drivers for my WD Passport Essential SE USB drive for SBS 2008
Removing Duplicate from a Crystal Report
Running reports and Log size
The SELECT permission was denied on the object 'sysdtspackages90', database 'msdb', schema 'dbo'.
look up table value with sql
Exchange Active Sync and self assigned certificates
How to set Public Folder "Retention" so that if a public folder is accidently deleted it can easily be recovered through Outlook or PFDAVadmin
How do I fix odbc call failed #1062 under access vba with a mysql backend?