Self join in SQL


Self join

Self join is a join in which a table is joined with itself , specially when the table has a FOREIGN KEY which references its own PRIMARY KEY. To join a table itself means that each row of the table is combined with itself and with every other row of the table.The self join can be viewed as a join of two copies of the same table. The table is not actually copied, but SQL performs the command as though it were.

Please Check the example Below. 






Why we can't execute a stored procedure from a User Defined function(UDF)

Functions cannot "touch" any database but read them only. Stored procedures can do anything and everything with databases. You ...