Forum Stats

  • 3,817,360 Users
  • 2,259,322 Discussions
  • 7,893,760 Comments

Discussions

Views in Physical Layer

Hi

I need to create a view in the Physical Layer using 'Select' using the following code:

select check_num, sum((dtl_mi_netto_ttl*dtl_typ_cnt)+vat-dtl_dsc_ttl) Amount
from mfd_check_dtl
having sum((dtl_mi_netto_ttl*dtl_typ_cnt)+vat-dtl_dsc_ttl) >= 0
group by check_num

I am getting an error "Syntax error near 'group' on line 4".

Is the problem the "having" line? Is there a way around it?

Thanks
Tagged:

Best Answer

  • Goran Ocko
    Goran Ocko Member Posts: 554
    Answer ✓
    The syntax is ok.

    Try to put having after group by:

    select check_num, sum((dtl_mi_netto_ttl*dtl_typ_cnt)+vat-dtl_dsc_ttl) Amount
    from mfd_check_dtl
    group by check_num
    having sum((dtl_mi_netto_ttl*dtl_typ_cnt)+vat-dtl_dsc_ttl) >= 0

    Regards
    Goran
    http://108obiee.blogspot.com

Answers

This discussion has been closed.