postgresql Pivoting using CrossTab - 1O Minutes

Поділитися
Вставка
  • Опубліковано 6 вер 2024
  • A Pivot Table is an effective technique for calculating, compiling, and analyzing data bound to simplify the search for patterns and trends. Pivot Tables can help you aggregate, sort, organize, reorganize, group, sum or average data stored in a database to understand data relations and dependencies in the best possible way.
    source file: raw.githubuser...
    FOLLOW ME ON:
    🐦 Twitter: / bretton73441979
    👀 LinkedIn: / gitonga-b. .
    📷 Instagram: / brettontelvin
    👨‍💻 GitHub Projects: github.com/bre...

КОМЕНТАРІ • 7

  • @jesthyrdevera9743
    @jesthyrdevera9743 2 місяці тому

    Hello - For some reasons some of the data extracted using crosstab does not align in the columns they are expected to. For example there are 5 columns and one of the records has values for 1, 3 and 5 but when I used crosstab the values for columns 1,3 and 5 goes to columns 1,2 and 3. What should I do to align those data properly? thank you for those who will respond.

  • @jeniamtl6950
    @jeniamtl6950 4 місяці тому

    what does order by does here?

  • @atharvanarwane6837
    @atharvanarwane6837 6 місяців тому

    I have some data where I do not know the number of exams data I have and I need to do this such that all those values get populated automatically without me defining explicitly the number of exams ?
    Can you please help?

    • @nguruTheGuru
      @nguruTheGuru  6 місяців тому

      I don't understand what you are asking brother

    • @atharvanarwane6837
      @atharvanarwane6837 6 місяців тому

      @@nguruTheGuru i have 5 columns of transactional data 3 of which are to be fixed i.e.
      A,B,C,Date, Quantity
      a1,b1,c1,2023-01-01,20
      a2,b2,c1,2024-01-02,80
      Should become
      A,B,C,2023-01-01,2024-01-02
      a1,b1,c1,20,0
      a2,b2,c2,0,80
      And there can be multiple records for multiple dates which should be populated automatically in postgres is there a way to do that? I.e. transpose only the date field to header and the quantity as the value...
      Context this would give us the unique combination of a,b,c as the total number of rows and then we can have columns as many unique dates as we have

  • @ylfe8061
    @ylfe8061 10 місяців тому

    Why volume so low?

    • @nguruTheGuru
      @nguruTheGuru  9 місяців тому

      apologies brother...we must have made a mistake when uploading