Good day, just learning SQL I can not figure out, the task is this: For each type of recovery, get the total number of imposed penalties for all types of posts

there is a database with the following tables and fields

Personal card

  • personal number
  • job code
  • Job title

achievement list

  • personal number
  • promotion date
  • kind of promotion
  • collection date
  • type of recovery to calculate the amount separately figured out

    SELECT "ΠŸΠΎΡΠ»ΡƒΠΆΠ½ΠΎΠΉ список"."Π’ΠΈΠ΄ взыскания", COUNT ("ΠŸΠΎΡΠ»ΡƒΠΆΠ½ΠΎΠΉ список"."Π’ΠΈΠ΄ взыскания") FROM public."Личная ΠΊΠ°Ρ€Ρ‚ΠΎΡ‡ΠΊΠ°", public."ΠŸΠΎΡΠ»ΡƒΠΆΠ½ΠΎΠΉ список" GROUP BY "ΠŸΠΎΡΠ»ΡƒΠΆΠ½ΠΎΠΉ список"."Π’ΠΈΠ΄ взыскания" 

and all together I do not understand how

  • And what is wrong? you now just get the type of recovery and the number of penalties of this type, without dividing into posts or whatever. - Akina
  • Yes, that's it, that's all right, I figured it out, I just need to get it with job - sharing - Serega Kuprienko
  • Add another field to the output set and to the group expression. - Akina
  • Oh, yes, for sure))) works))) thank you very much) - Serge Kuprienko

0