C# Corner


About Self-Join

Self Join also known as an inner join and it is a structured query language (SQL) statement where a queried table is joined to itself. The Self Join statement is necessary used when two sets of data within the same table which are compared with each other. Employee name ,Employee ID and employee manager’s in that case the managers are also employees, the MANAGER_ID column also contains the ID of another employee that is also the manager. for example we are write a query to extract the employee and manager names and IDs, the table must be logically split in half to run two separate queries: employees (first table) and managers (second table). This is achieved by running the following sample SQL query: SELECT a.employee_name, b.employee_name as Manager_name FROM employees as a, employees as b WHERE a.manager_id = b.employee_id.


Custom Software Development
MCN is your source for developing solutions involving websites, mobile apps, cloud-computing, databases, BI, back-end services and processes and client-server applications.
C# Corner Hyderabad Developer Conference