Advertisement
GLASHATAY_007

summ/count

Mar 16th, 2023
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. select
  2.     sum(p.price) summ,
  3.     count(c.id ) as cnt
  4. From contract_eshop.contract As c
  5.  Inner Join contract_eshop.contract_sign As s On (c.sign_id=s.id)
  6.  Inner Join contract_eshop.contract_status As cst On (c.status_id=cst.id)
  7.  Inner Join contract_eshop.contract_sign_price_info As p On (s.price_info_id=p.id)
  8. where extract(year from s.comming_sign_date)=2023
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement