Fetch the details of doctors who work in the same hospital but in different specialty
Approach
Whenever we need to compare each record in a table with itself we need to make use of self join
As we don’t want to compare a record with itself extra condition for not checking same ids need to be added
Learn how to write SQL Queries(Practice Complex SQL Queries) — techTFQ