Question

I am trying to run the following query using a OracleCommand class.

But but I get this error:

"ORA-00920 invalid relational operator".

I am sure it is to do with the date values. But do not know how to fix it. could you help?

  select s.store_code,count(i.invc_sid) as count 
  from invoice_v i 
  Left join store_v s 
     ON i.sbs_no and i.store_no = s.store_no 
  Where(i.created_date between to_date('02//01//2014','MM//DD//YY') 
       and to_date('02//28//2014','MM//DD//YY'))  
       and i.proc_status not in ('131072','65536','147456', '81920') 
       and i.invc_type = 0 AND i.sbs_no = 6  
  GROUP BY  s.store_code";

Thanks

Was it helpful?

Solution

Your problem is in following line

Left join store_v s 
     ON i.sbs_no and i.store_no = s.store_no 

Here, after 'ON' you have written only i.sbs_no .

There should be something after this to compare like

ON i.sbs_no = 'Something' and i.store_no = s.store_no
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top