<?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: PL/SQL query in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/pl-sql-query/m-p/4386564#M665474</link>
    <description>select a.SECTION,a.JOB_NO,b.SURVEYOR from JOB_MASTER a, JOB_ALLOCATION b where a.JOB_NO=b.JOB_NO;</description>
    <pubDate>Tue, 24 Mar 2009 10:31:29 GMT</pubDate>
    <dc:creator>T G Manikandan</dc:creator>
    <dc:date>2009-03-24T10:31:29Z</dc:date>
    <item>
      <title>PL/SQL query</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pl-sql-query/m-p/4386563#M665473</link>
      <description>Dear all,&lt;BR /&gt;&lt;BR /&gt;I have two tables JOb_master and &lt;BR /&gt;Job_allocation.&lt;BR /&gt;Job_master columns&lt;BR /&gt; JOB_NO&lt;BR /&gt; SECTION&lt;BR /&gt; ISSUE_DATE&lt;BR /&gt;&lt;BR /&gt;Job_alloction columns&lt;BR /&gt; &lt;BR /&gt;JOB_NO&lt;BR /&gt;ALLOCATION_DT&lt;BR /&gt;SURVEYOR&lt;BR /&gt;&lt;BR /&gt;Using the two tables I need the stament like&lt;BR /&gt;Surveyor,job_no,section&lt;BR /&gt;&lt;BR /&gt;for this I wrote the query like&lt;BR /&gt;select surveyor,a.job_no,section from job_master a,job_allocation b where a.job_no in (select job_no from job_allocation) and a.job_no=b.job_no;&lt;BR /&gt;&lt;BR /&gt;but it return duplicate rows,as per  howmany times the job_no in job_allocation table.&lt;BR /&gt;could you plese find a solution.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Pradeep&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 24 Mar 2009 09:59:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pl-sql-query/m-p/4386563#M665473</guid>
      <dc:creator>PRDEEP</dc:creator>
      <dc:date>2009-03-24T09:59:15Z</dc:date>
    </item>
    <item>
      <title>Re: PL/SQL query</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pl-sql-query/m-p/4386564#M665474</link>
      <description>select a.SECTION,a.JOB_NO,b.SURVEYOR from JOB_MASTER a, JOB_ALLOCATION b where a.JOB_NO=b.JOB_NO;</description>
      <pubDate>Tue, 24 Mar 2009 10:31:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pl-sql-query/m-p/4386564#M665474</guid>
      <dc:creator>T G Manikandan</dc:creator>
      <dc:date>2009-03-24T10:31:29Z</dc:date>
    </item>
    <item>
      <title>Re: PL/SQL query</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pl-sql-query/m-p/4386565#M665475</link>
      <description>Hi Pradeep,&lt;BR /&gt;&lt;BR /&gt;Because the the JOB_NO is unique on Job_master (I believe it is the primary key on master table) and multi rows for each JOB_NO on Job_allocation, you will get duplicate rows definitly. &lt;BR /&gt;&lt;BR /&gt;use the following:&lt;BR /&gt;select distinct surveyor,a.job_no,section from job_master a,job_allocation b where a.job_no=b.job_no;&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Xiaoang</description>
      <pubDate>Tue, 24 Mar 2009 15:08:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pl-sql-query/m-p/4386565#M665475</guid>
      <dc:creator>Xiaogang Zheng</dc:creator>
      <dc:date>2009-03-24T15:08:51Z</dc:date>
    </item>
    <item>
      <title>Re: PL/SQL query</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pl-sql-query/m-p/4386566#M665476</link>
      <description>Dear Pradeep&lt;BR /&gt;&lt;BR /&gt;select surveyor,a.job_no,section from job_master a,job_allocation b where &lt;BR /&gt;a.job_no=b.job_no;&lt;BR /&gt;&lt;BR /&gt;I think this query is sufficient&lt;BR /&gt;one is primary key and second one is foriegn &lt;BR /&gt;key both are related through constraint mechanism&lt;BR /&gt;&lt;BR /&gt;thanks and regards&lt;BR /&gt;&lt;BR /&gt;Sajjad Sahir</description>
      <pubDate>Wed, 25 Mar 2009 06:31:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pl-sql-query/m-p/4386566#M665476</guid>
      <dc:creator>Sajjad Sahir</dc:creator>
      <dc:date>2009-03-25T06:31:41Z</dc:date>
    </item>
    <item>
      <title>Re: PL/SQL query</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pl-sql-query/m-p/4386567#M665477</link>
      <description>Thanks all of you,&lt;BR /&gt;but I got the same result as before,&lt;BR /&gt;and using distinct it return only one row.&lt;BR /&gt;For your reference I give the data as follows.&lt;BR /&gt;In Job Master table data as follows:-&lt;BR /&gt;Job_no     Section   Issue_date&lt;BR /&gt;&lt;BR /&gt;5450         A      31-AUG-08 &lt;BR /&gt;5450         B      31-AUG-08  &lt;BR /&gt;5450         P      04-SEP-08 &lt;BR /&gt;5450         Y      04-NOV-08  &lt;BR /&gt;5450         Y      26-NOV-08  &lt;BR /&gt;5450         A      30-NOV-08  &lt;BR /&gt;5450         P      10-NOV-08 &lt;BR /&gt;&lt;BR /&gt;Job_allocation table &lt;BR /&gt;&lt;BR /&gt;Job_no   Allocation _date    Surveyor&lt;BR /&gt;&lt;BR /&gt;5450      04-NOV-08           1233445  &lt;BR /&gt;5450      26-NOV-08           1233445&lt;BR /&gt;&lt;BR /&gt;I need the result as follows&lt;BR /&gt;&lt;BR /&gt;Surveyor  Job_no     Section &lt;BR /&gt;&lt;BR /&gt;1233445   5450         Y      &lt;BR /&gt;1233445   5450         Y        &lt;BR /&gt;&lt;BR /&gt;while run the following query&lt;BR /&gt;select b.SURVEYOR,a.JOB_NO, a.SECTION from JOB_MASTER a, JOB_ALLOCATION b where a.JOB_NO=b.JOB_NO and section='Y';&lt;BR /&gt;&lt;BR /&gt;It give wrong result or duplicate rows.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sun, 29 Mar 2009 04:42:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pl-sql-query/m-p/4386567#M665477</guid>
      <dc:creator>PRDEEP</dc:creator>
      <dc:date>2009-03-29T04:42:12Z</dc:date>
    </item>
    <item>
      <title>Re: PL/SQL query</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pl-sql-query/m-p/4386568#M665478</link>
      <description>You can always take the duplicates out, by using the 'shadow' column rowid&lt;BR /&gt;&lt;BR /&gt;eg.&lt;BR /&gt;&lt;BR /&gt;create table owner.master_new&lt;BR /&gt;as&lt;BR /&gt;select * from owner.master x1&lt;BR /&gt;where x1.rowid &amp;lt;&amp;gt; (select max(x2.rowid) from history x2&lt;BR /&gt;                 where x1.ci_item = x2.ci_item)&lt;BR /&gt;&lt;BR /&gt;If you want it to transpose to your concrete situation let us know&lt;BR /&gt;</description>
      <pubDate>Mon, 06 Apr 2009 05:24:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pl-sql-query/m-p/4386568#M665478</guid>
      <dc:creator>Frank de Vries</dc:creator>
      <dc:date>2009-04-06T05:24:55Z</dc:date>
    </item>
  </channel>
</rss>

