Skip to main content

Posts

Showing posts with the label self join

SQL Join Query Tips-Example of right ,self query itselft,anti ,left join,Full outer join

Example of self join query in sql. Summary : If you are looking for information like self join query mean table used self as join let us see following example to get more clear. Hear I used  right join with self join. Example of self join query in sql,right join,self join,join query itself. select * from emp where empno not in (select e.empno from emp e right join dept d on e.empno = d.empno) How to use self join in sql select query Example of self join: To find the IDs which have a different department: select distinct A.id  from myTable A join myTable B on A.id = B.id where A.dept <> B.dept Example of join select query in sql Query to get a list of all students who have a certain checklist item (MFST) with a status of Initiated where all other checklist items have a status of Completed. Should I be using Exists or should I be using someting else? SELECT A.COMMON_ID,         B.AID_YEAR,         C.CHKLST_ITEM_CD,         C.ITEM_STATUS FROM PS_PERSON