Note that there are some explanatory texts on larger screens.

plurals
  1. POdisplay all records on outer join
    primarykey
    data
    text
    <p>I have one table where for a particular project, dates for 9 months are stored (given below)</p> <pre><code>01-01-13 50036 027490101 WO12PS00003 01-02-13 50036 027490101 WO12PS00003 01-03-13 50036 027490101 WO12PS00003 01-04-13 50036 027490101 WO12PS00003 01-05-13 50036 027490101 WO12PS00003 01-06-13 50036 027490101 WO12PS00003 01-07-13 50036 027490101 WO12PS00003 01-08-13 50036 027490101 WO12PS00003 01-09-13 50036 027490101 WO12PS00003 </code></pre> <p>i have and another table where the weight is present only for few months.i want the final output to be like (to display all months and wt as 0 for those where data is not present in the second table)</p> <pre><code> projec sl tech_no mon yr wt ident dt 027490101 35 WO12PS00003 01 2014 200 50036 01-01-13 027490101 35 WO12PS00003 02 2014 0 50036 01-02-13 027490101 35 WO12PS00003 09 2013 107 50036 01-03-13 027490101 35 WO12PS00003 10 2013 0 50036 01-04-13 027490101 35 WO12PS00003 11 2013 0 50036 01-05-13 027490101 36 WO12PS00003 02 2014 200 50036 01-06-13 027490101 36 WO12PS00003 12 2013 400 50036 01-07-13 027490101 77 WO12PS00003 11 2013 0 50036 01-08-13 027490101 77 WO12PS00003 12 2013 3321 50036 01-09-13 </code></pre> <p>my query was: </p> <pre><code>select a.projec,sl,a.tech_no,a.mon,a.yr,nvl(sum(a.wt),0) plan_sum ,b.ident,b.dt from pp_init_plan a,pp_mon b where a.projec=b.projec and a.sl=b.sl and and to_Char(b.dt(+),'yyyy')=yr and to_char(b.dt(+),'mm') =a.mon group by a.projec,a.slno,a.tech_no,a.mon,a.yr,b.ident,b.dt order by a.tech_no,a.mon,a.yr,b.ident,b.dt </code></pre> <p>It did not work! Just returned the matching records. please help!Thanks in advance!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload