Oracle Pivot with group total computation

Поделиться
HTML-код
  • Опубликовано: 20 окт 2024

Комментарии • 83

  • @murugesanpitchaikani4808
    @murugesanpitchaikani4808 3 года назад +4

    Hi, we are hard coded column values in pivot. Is it possible to pass dynamic query in pivot clause? Except xml...

  • @MrBandhuraj
    @MrBandhuraj 10 месяцев назад

    Great RUclips lesson. I learned a lot about pivot and cube. Question: if I have 2 aggregate sum() and count() in pivot the output is with 2 columns for each department displaying horizontally, How would you display sum() and count() in 2 different rows under a department column for each Job.

  • @Anushkathecuteprincess
    @Anushkathecuteprincess Год назад

    Really very helpful.. but i want to implement it into dynamic columns, i have implemented the dynamic columns query but i want to add this logic on it. and one more i want to add other columns as well, how we can add other columns in group by

  • @niyije
    @niyije 2 года назад

    Thank you a lot! it runs in Oracle

  • @vijayarjunwadkar
    @vijayarjunwadkar 4 года назад

    Nice video teaching use of Pivot in Oracle SQL. I was struggling with this a bit, but you clarified it in a detailed and smooth way! Thanks a lot! 😊👍 Watching your other videos too...

  • @sridhartamilselvan
    @sridhartamilselvan 5 лет назад +1

    Your's teaching skill is awesome 👌

  • @Hemanthmech
    @Hemanthmech 3 года назад +1

    Excellent teaching thank you

  • @janf5021
    @janf5021 2 года назад

    Oracle is unable to truely pivot dynamically. it works if you declare the column manually in the pivot statement, it does NOT work if you declare it with an inner select statement.
    The recommendation ist to go via XML, but this will NOT Produce a table column, it creates a XML Tag with a Single Column of the table.
    Then you can click a setting that PL/SQL or other INTERPRETE XML like a table - but it still is not.

  • @rahulbadhe5930
    @rahulbadhe5930 5 лет назад +2

    thank you sir ,, its very good session.
    please take a performance tuning about session , its more needed.

    • @SivaAcademy
      @SivaAcademy  5 лет назад

      @Rahul, Thanks for your comments, Sure will start posting performance related videos soon, Please stay tuned.

  • @sujaa1000
    @sujaa1000 4 года назад +2

    Siva,
    How is 'TOTAL' itself taken as a deptno, can you please explain that?
    The inner query has deptno, job and total_sal computed, but 'TOTAL' in "deptno in (10,20,30,'TOTAL') is confusing, where is 'TOTAL' computed?
    Regards,
    Sujaa

    • @SivaAcademy
      @SivaAcademy  4 года назад +1

      In the innser query where i have used the nvl(job, 'TOTAL') and nvl(deptno, 'TOTAL'), this will be used in the outer query to compute the overall total value

    • @sujaa1000
      @sujaa1000 4 года назад

      @@SivaAcademy Thank you Siva

  • @VinayKumar-ij4eu
    @VinayKumar-ij4eu 2 года назад

    Thanks Siva for this video!!

  • @sajeedshaik7280
    @sajeedshaik7280 4 года назад +1

    thanks for posting valuble info..

  • @surajmokatkar
    @surajmokatkar 4 года назад

    Good Explanation.Precise.

  • @govindaraju3265
    @govindaraju3265 Год назад

    Hi sir, well explained with a simple method. Thanks,I have a question like how to get row% and column% as we do in excel

  • @Andhrasinchennai
    @Andhrasinchennai 2 года назад

    Excellent explanation

  • @VethakaliVethuku
    @VethakaliVethuku 3 года назад +1

    Good Explanation :) Cube ,Rollup

  • @vinaygajjelli8028
    @vinaygajjelli8028 4 года назад

    i have 10g in my lappy which is not usefull to do any pivot clause..it can be done from 11g version

  • @mahendra7121
    @mahendra7121 3 года назад

    Can we get same output without using pivot operation ?

  • @karthikeyan9592
    @karthikeyan9592 3 месяца назад

    Great 👍

  • @md.rahimuddinshohag7202
    @md.rahimuddinshohag7202 3 года назад

    Thank you so much

  • @TamilManivs
    @TamilManivs 3 года назад

    Outstanding teaching skill bro

  • @ramus6188
    @ramus6188 2 года назад

    SUB GROUP NOT MENTIONED. CAN WE EXPECT IT

  • @chinarisubudhi8865
    @chinarisubudhi8865 3 года назад

    Nicely explained..

  • @shashikumarn.s859
    @shashikumarn.s859 3 года назад

    Amazing teaching thanks

  • @rk-ej9ep
    @rk-ej9ep 2 года назад

    Excellent sir...

  • @funzone123456
    @funzone123456 4 года назад

    very good video. pivot explanation simplified rather using traditional max decode logic

  • @bhushanpalse516
    @bhushanpalse516 3 года назад

    Sir if there are 3 tables in from clause,then how to use this pivot

    • @SivaAcademy
      @SivaAcademy  3 года назад

      Pivot is for result set of any query having any number of tables, inner query can have any number of tables

  • @vaniganapathi830
    @vaniganapathi830 2 года назад

    Thank you so much sir

  • @dheenadhayalan2091
    @dheenadhayalan2091 4 года назад

    Thanks Very useful, can we use this qry in Oracle report to design same structure ?

    • @SivaAcademy
      @SivaAcademy  4 года назад

      Thanks bro, I am not sure about Oracle reports

  • @BongFoody
    @BongFoody 4 года назад

    Sir, I didnt understand why you wrote sum(sal) in the pivot section. As we are already having all the totals using the cube clause, so what the pivot sum(sal) is doing.

    • @BongFoody
      @BongFoody 4 года назад

      I think i found the answer - the sum(sal) in the pivot section is just giving the sum group by job from the inner query, but as the innerquery has all the unique permutation/combination- thus providing the same reault as transposed in the final output. Sir, Please correct in case i an having wrong understanding.

    • @SivaAcademy
      @SivaAcademy  4 года назад

      You are right, anyway we are having unique combination in inner query, outer sum is not needed, but we added just for the pivot syntax, otherwise pivot won't work

    • @BongFoody
      @BongFoody 4 года назад

      Thanks Sir

  • @pranayk2840
    @pranayk2840 4 года назад

    Hello Sir, I'm getting the below error:
    ORA-01748: only simple column names allowed here

    • @SivaAcademy
      @SivaAcademy  4 года назад

      can you please send me the query you tried.

  • @neverstopexploring5265
    @neverstopexploring5265 4 года назад

    It is very useful brother

  • @vsr1727
    @vsr1727 4 года назад

    Thanks Siva

  • @boyachi002
    @boyachi002 5 лет назад

    How do i use pivot function by dynamic condition like below source ?
    pivot (sum(TiresShift) for BuildingStartShift in
    (
    select to_char(sysdate,'YYYYMMDD')||1 "NOW1",to_char(sysdate,'YYYYMMDD')||2 "NOW2",to_char(sysdate,'YYYYMMDD')||3 "NOW3"
    from dual
    ))
    order by 2,1
    ;

    • @SivaAcademy
      @SivaAcademy  5 лет назад

      Pivot is not very flexible in terms of dynamic inputs, however you can explore 18C Polymorphic Table Functions

  • @pankajkharade6936
    @pankajkharade6936 3 года назад

    Superb Sir 👍👍👍

  • @KrishnaPaneri
    @KrishnaPaneri 4 года назад

    Thank you 👌🏿👍🏿

    • @SivaAcademy
      @SivaAcademy  4 года назад

      You’re welcome 😊

    • @SivaAcademy
      @SivaAcademy  4 года назад

      Please look into this video
      ruclips.net/video/KzuWCLPomcY/видео.html

  • @reshmabahadur7564
    @reshmabahadur7564 3 года назад

    Siva, how much will b charged for the complete course and duration??

    • @SivaAcademy
      @SivaAcademy  3 года назад

      please drop mail to siva.k.academy@gmail.com

  • @deepakmeda8049
    @deepakmeda8049 4 года назад

    Super bro.

  • @tharinduhasitha3618
    @tharinduhasitha3618 4 года назад

    Thanks

  • @alladivamshikrishna228
    @alladivamshikrishna228 5 лет назад

    hi sir, can we do cummilative sum to some particular rows in one column.

    • @SivaAcademy
      @SivaAcademy  5 лет назад +1

      Yes, you can write entire query in inner subquery, and in outer query you compute cumulative sum

    • @alladivamshikrishna228
      @alladivamshikrishna228 5 лет назад

      ​@@SivaAcademy
      emp_id emp_sal cummilative sum
      ----------- ------------ ---------------
      ------------
      1 10 ------------------- 10 (as it is)
      2 35 ------------------- 45 (cummilative sum.i.e, 35+10=45)
      3 55 ------------------- 55 (as it is)
      4 40 ------------------- 40 (as it is)
      5 35 ------------------- 75 (cummilative sum.i.e, 35+40=75)
      6 85 ------------------- 85 (as it is)
      7 25 ------------------- 25 (as it is)
      8 65 ------------------- 90 (cummilative sum.i.e, 65+25=90)
      9 45 ------------------- 45 (as it is)
      10 65 ------------------- 65 (as it is)
      This is requirement sir, is this possible? if it is possible, can i have query for that.

  • @849ramzes
    @849ramzes 4 года назад

    Gj Buddy 👍🏻

  • @tejupansare4947
    @tejupansare4947 4 года назад

    U r any institute available in Pune

  • @reshmabahadur7564
    @reshmabahadur7564 3 года назад

    👍👍