<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: hi all in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/hi-all/m-p/2632968#M605571</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Self join:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A self-join is a query in which a table is joined (compared) to itself.  Self-joins are used to compare values in a column with other values in the same column in the same table.  One practical use for self-joins:  obtaining running counts and running totals in an SQL query. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Eg: Select from the same table listed twice with different aliases, set up the comparison, and eliminate cases where a particular value would be equal to itself.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Equi join:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Equi join is the join which contains an equal operator in its join condition.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 02 Aug 2007 08:41:56 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-08-02T08:41:56Z</dc:date>
    <item>
      <title>hi all</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hi-all/m-p/2632966#M605569</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi all&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;could anybody give me how and when to use self join and equi join???&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;syntax + when to use self and when to use equi join???&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanx&lt;/P&gt;&lt;P&gt;rocky&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Aug 2007 14:24:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hi-all/m-p/2632966#M605569</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-01T14:24:50Z</dc:date>
    </item>
    <item>
      <title>Re: hi all</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hi-all/m-p/2632967#M605570</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;self join--A join in which a table is joined with itself. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;equijoin--A join statement that uses an equivalency operation. The converse of this is the nonequijoin operation. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Equi joins  - contains only = sign&lt;/P&gt;&lt;P&gt;Non-Equi Joins - other simbles&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;anju&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Aug 2007 08:30:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hi-all/m-p/2632967#M605570</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-02T08:30:01Z</dc:date>
    </item>
    <item>
      <title>Re: hi all</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hi-all/m-p/2632968#M605571</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Self join:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A self-join is a query in which a table is joined (compared) to itself.  Self-joins are used to compare values in a column with other values in the same column in the same table.  One practical use for self-joins:  obtaining running counts and running totals in an SQL query. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Eg: Select from the same table listed twice with different aliases, set up the comparison, and eliminate cases where a particular value would be equal to itself.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Equi join:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Equi join is the join which contains an equal operator in its join condition.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Aug 2007 08:41:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hi-all/m-p/2632968#M605571</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-02T08:41:56Z</dc:date>
    </item>
    <item>
      <title>Re: hi all</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hi-all/m-p/2632969#M605572</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rocky,,,,,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; You hav got the defination of both joins from above answer ...&lt;/P&gt;&lt;P&gt;   Here i am sending you some sample code with syntax...&lt;/P&gt;&lt;P&gt;    It may clear your doubts...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &amp;lt;i&amp;gt;&amp;lt;b&amp;gt;SELF-JOIN&amp;lt;/b&amp;gt;&amp;lt;/i&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   Self-Join is a concept where we are join a table to itself. This is useful when we want some particular information on join a table to itself. For eg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EMPNO ENAME MGR&lt;/P&gt;&lt;P&gt;1            AA          2&lt;/P&gt;&lt;P&gt;2            BB          Null&lt;/P&gt;&lt;P&gt;3            CC            1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the above example we have a empno column and mgr column . In general they are the empno values only. Now if you have a query to find who is the manager for each then if i have to retrieve the data then we have to join the table to itself.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the example for self join,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Employee table is re is a table with structure as,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EmpId int&lt;/P&gt;&lt;P&gt;EmpName varchar(20)&lt;/P&gt;&lt;P&gt;Address varchar(50)&lt;/P&gt;&lt;P&gt;ManagerId int&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here ManagerId references some record in the Employee table itself. &lt;/P&gt;&lt;P&gt;Write a query to fetch the Name of the manager (employee), who manages an employee whose employee id is given.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Query:&lt;/P&gt;&lt;P&gt;Select m.EmpId ManagerId, m.EmpName ManagerName &lt;/P&gt;&lt;P&gt;From Employee e inner join Employee m on e.ManagerId = m.EmpId&lt;/P&gt;&lt;P&gt;Where e.EmpId = 1111&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&amp;lt;i&amp;gt;&amp;lt;b&amp;gt;One More Example of SELF JOIN&amp;lt;/b&amp;gt;&amp;lt;/i&amp;gt; &lt;/P&gt;&lt;P&gt;    Joining the same tbale to itself &lt;/P&gt;&lt;P&gt;     use Pubs  SELECT &lt;/P&gt;&lt;P&gt;        authors.au_fname, &lt;/P&gt;&lt;P&gt;        authors.au_lname, &lt;/P&gt;&lt;P&gt;        authors1.au_fname AS Expr2, &lt;/P&gt;&lt;P&gt;        authors1.au_lname AS Expr3&lt;/P&gt;&lt;P&gt;     FROM &lt;/P&gt;&lt;P&gt;        authors &lt;/P&gt;&lt;P&gt;           INNER JOIN&lt;/P&gt;&lt;P&gt;           authors authors1 &lt;/P&gt;&lt;P&gt;              ON authors.city &lt;/P&gt;&lt;P&gt;               = authors1.city&lt;/P&gt;&lt;P&gt;              AND authors.au_id&lt;/P&gt;&lt;P&gt;               &amp;lt; authors1.au_id&lt;/P&gt;&lt;P&gt;     WHERE&lt;/P&gt;&lt;P&gt;        authors.city = 'Berkeley'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Plz Reward points if answer is useful...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Regards,&lt;/P&gt;&lt;P&gt;Mandeep.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Aug 2007 09:07:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hi-all/m-p/2632969#M605572</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-02T09:07:39Z</dc:date>
    </item>
  </channel>
</rss>

