Top "Self-join" questions

A table can be joined to itself and this is called a self-join.

Simple Self Join Query Bad Performance

Could anyone advice on how do I improve the performance of the following query. Note, the problem seems to be …

sql sql-server sql-server-2008 self-join sqlperformance
how do I add a foreign key pointing to the same table using phpMyAdmin?

I have an existing InnoDB table which already has foreign keys pointing to different tables. But when I try to …

mysql foreign-keys innodb self-join phpmyadmin
How do I do reflexive self-join relationships in ActiveRecord?

I'm trying to implement a social networking style friendship model and I didnt have much much luck trying to figure …

ruby-on-rails activerecord social-networking self-join
Rails: self join scheme with has_and_belongs_to_many?

I would like to create a structure of Users having many friends, also of class User: class User < ActiveRecord::…

ruby-on-rails self-join
SQL: self join using each rows only once

Possible Duplicate: combinations (not permutations) from cross join in sql I've currently got a table with the following records: A1 …

sql join self-join
Self join with inner and outer join query

I have a table that is set up so that one column (attribute) contains information like first name, last name, …

sql sql-server inner-join outer-join self-join
Self-join on a table with ActiveRecord

I have an ActiveRecord called Name which contains names in various Languages. class Name < ActiveRecord::Base belongs_to :language …

ruby-on-rails activerecord mysql self-join
combinations (not permutations) from cross join in sql

If I have a table that I'd like to cross join to itself, how can I remove the duplicate rows? …

sql self-join cross-join