I'm having trouble understanding why the output is the way it is for this self join. The code for the table I'm dealing with is:
create table point_2d (x INT, y INT);
insert into point_2d values (-1, -1);
insert into point_2d values (0,0);
insert into point_2d values (-1, -2);
I want to execute a self join as follows:
SELECT *
FROM
point_2d p1
Inner JOIN
point_2d p2
ON p1.x != p2.y;
it's the ON clause that's confusing me with the output. How exactly is this table self-joining given the condition
p1.x != p2.y
in the code above?