Top "Self-join" questions

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

What is SELF JOIN and when would you use it?

What is self join and when would you use it? I don't understand self joins so a layman explanation with …

sql self-join
INNER JOIN same table

I am trying to get some rows from the same table. It's a user table: user has user_id and …

mysql sql join self-join
Simplest way to do a recursive self-join?

What is the simplest way of doing a recursive self-join in SQL Server? I have a table like this: PersonID | …

sql sql-server recursion hierarchical-data self-join
Explanation of self-joins

I don't understand the need for self-joins. Can someone please explain them to me? A simple example would be very …

sql self-join
MySql. How to use Self Join

I need to use Self Join on this table. +------------+------+--------+ | Country | Rank | Year | +------------+------+--------+ |France | 55 | 2000 | +------------+…

mysql sql self-join
Comparing SQL Table to itself (Self-join)

I'm trying to find duplicate rows based on mixed columns. This is an example of what I have: CREATE TABLE …

sql join self-join
Rails: How do self-referential has_many models work?

So, I'm working on an app where I want to users to be able to group objects in "folders". Basically: …

ruby-on-rails ruby-on-rails-3 activerecord model self-join
How to left join or inner join a table itself

I have this data in a table, for instance, id name parent parent_id 1 add self 100 2 manage null 100 3 add 10 200 4 manage …

mysql sql left-join inner-join self-join
Multiple Foreign keys to a single table and single key pointing to more than one table

I need some suggestions from the database design experts here. I have around six foreign keys into a single table (…

database-design join foreign-keys self-join
Mysql Self Join to find a parent child relationship in the same table

Im trying to calculate the amount of money won by all the offspring of a male race horse (Sire) over …

mysql sql self-join