Oracle Pivot with group total computation

  Рет қаралды 23,892

Siva Academy

Siva Academy

Күн бұрын

Oracle Pivot with group total computation
Watch this video for PIVOT clause
• Oracle Pivot clause | ...
Click here to subscribe to my youtube channel / @sivaacademy
Oracle Interview questions and Answers at • oracle interview quest...
Oracle 18C New features at • Oracle 18C New Feature
Oracle 12C New features at • Oracle 12C New Feature...
Oracle PLSQL records and collections at • oracle plsql records a...

Пікірлер: 83
@MrBandhuraj
@MrBandhuraj 10 ай бұрын
Great KZbin 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.
@murugesanpitchaikani4808
@murugesanpitchaikani4808 3 жыл бұрын
Hi, we are hard coded column values in pivot. Is it possible to pass dynamic query in pivot clause? Except xml...
@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
@rahulbadhe5930
@rahulbadhe5930 5 жыл бұрын
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.
@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...
@SivaAcademy
@SivaAcademy 4 жыл бұрын
Thank you bro 💐
@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
@sujaa1000
@sujaa1000 4 жыл бұрын
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 жыл бұрын
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
@sridhartamilselvan
@sridhartamilselvan 5 жыл бұрын
Your's teaching skill is awesome 👌
@SivaAcademy
@SivaAcademy 5 жыл бұрын
🙏🙏🙏
@SivaAcademy
@SivaAcademy 5 жыл бұрын
@sridhar thank you ☺️
@niyije
@niyije 2 жыл бұрын
Thank you a lot! it runs in Oracle
@SivaAcademy
@SivaAcademy 2 жыл бұрын
Welcome 💐🙏👍
@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.
@VinayKumar-ij4eu
@VinayKumar-ij4eu 2 жыл бұрын
Thanks Siva for this video!!
@SivaAcademy
@SivaAcademy 2 жыл бұрын
Welcome bro
@mahendra7121
@mahendra7121 3 жыл бұрын
Can we get same output without using pivot operation ?
@Hemanthmech
@Hemanthmech 3 жыл бұрын
Excellent teaching thank you
@SivaAcademy
@SivaAcademy 3 жыл бұрын
Welcome 💐
@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
@sajeedshaik7280
@sajeedshaik7280 4 жыл бұрын
thanks for posting valuble info..
@SivaAcademy
@SivaAcademy 4 жыл бұрын
Welcome 🙏👍
@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
@ramus6188
@ramus6188 2 жыл бұрын
SUB GROUP NOT MENTIONED. CAN WE EXPECT IT
@karthikeyan9592
@karthikeyan9592 3 ай бұрын
Great 👍
@surajmokatkar
@surajmokatkar 4 жыл бұрын
Good Explanation.Precise.
@SivaAcademy
@SivaAcademy 4 жыл бұрын
Thank you
@Andhrasinchennai
@Andhrasinchennai 2 жыл бұрын
Excellent explanation
@SivaAcademy
@SivaAcademy 2 жыл бұрын
Thank you
@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
@md.rahimuddinshohag7202
@md.rahimuddinshohag7202 3 жыл бұрын
Thank you so much
@SivaAcademy
@SivaAcademy 3 жыл бұрын
Welcome 💐
@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
@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
@funzone123456
@funzone123456 4 жыл бұрын
very good video. pivot explanation simplified rather using traditional max decode logic
@SivaAcademy
@SivaAcademy 4 жыл бұрын
Welcome 👍💐
@VethakaliVethuku
@VethakaliVethuku 3 жыл бұрын
Good Explanation :) Cube ,Rollup
@SivaAcademy
@SivaAcademy 3 жыл бұрын
Thank you
@chinarisubudhi8865
@chinarisubudhi8865 3 жыл бұрын
Nicely explained..
@SivaAcademy
@SivaAcademy 3 жыл бұрын
Thank you so much 🙂
@vaniganapathi830
@vaniganapathi830 2 жыл бұрын
Thank you so much sir
@SivaAcademy
@SivaAcademy 2 жыл бұрын
Most welcome
@rk-ej9ep
@rk-ej9ep 2 жыл бұрын
Excellent sir...
@SivaAcademy
@SivaAcademy 2 жыл бұрын
Thank you
@TamilManivs
@TamilManivs 3 жыл бұрын
Outstanding teaching skill bro
@SivaAcademy
@SivaAcademy 3 жыл бұрын
Thank you 💐 bro
@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.
@shashikumarn.s859
@shashikumarn.s859 3 жыл бұрын
Amazing teaching thanks
@SivaAcademy
@SivaAcademy 3 жыл бұрын
Welcome 🙏💐
@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
@alladivamshikrishna228
@alladivamshikrishna228 5 жыл бұрын
hi sir, can we do cummilative sum to some particular rows in one column.
@SivaAcademy
@SivaAcademy 5 жыл бұрын
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.
@vsr1727
@vsr1727 4 жыл бұрын
Thanks Siva
@tejupansare4947
@tejupansare4947 4 жыл бұрын
U r any institute available in Pune
@SivaAcademy
@SivaAcademy 4 жыл бұрын
No... Only online
@neverstopexploring5265
@neverstopexploring5265 4 жыл бұрын
It is very useful brother
@SivaAcademy
@SivaAcademy 4 жыл бұрын
Welcome 🙏 bro
@KrishnaPaneri
@KrishnaPaneri 4 жыл бұрын
Thank you 👌🏿👍🏿
@SivaAcademy
@SivaAcademy 4 жыл бұрын
You’re welcome 😊
@SivaAcademy
@SivaAcademy 4 жыл бұрын
Please look into this video kzbin.info/www/bejne/gavYiHaChdSgmbs
@pankajkharade6936
@pankajkharade6936 3 жыл бұрын
Superb Sir 👍👍👍
@SivaAcademy
@SivaAcademy 3 жыл бұрын
Welcome bro
@tharinduhasitha3618
@tharinduhasitha3618 4 жыл бұрын
Thanks
@SivaAcademy
@SivaAcademy 4 жыл бұрын
Welcome 🙏
@deepakmeda8049
@deepakmeda8049 4 жыл бұрын
Super bro.
@SivaAcademy
@SivaAcademy 4 жыл бұрын
🙏
@849ramzes
@849ramzes 4 жыл бұрын
Gj Buddy 👍🏻
@SivaAcademy
@SivaAcademy 4 жыл бұрын
Thank you 🙏
@reshmabahadur7564
@reshmabahadur7564 3 жыл бұрын
👍👍
@SivaAcademy
@SivaAcademy 3 жыл бұрын
Thank you
Oracle Pragma Serially Reusable
7:08
Siva Academy
Рет қаралды 12 М.
SQL Tutorial - PIVOT
13:11
BeardedDev
Рет қаралды 129 М.
didn't manage to catch the ball #tiktok
00:19
Анастасия Тарасова
Рет қаралды 31 МЛН
Mom had to stand up for the whole family!❤️😍😁
00:39
Inside Out 2: ENVY & DISGUST STOLE JOY's DRINKS!!
00:32
AnythingAlexia
Рет қаралды 18 МЛН
😜 #aminkavitaminka #aminokka #аминкавитаминка
00:14
Аминка Витаминка
Рет қаралды 608 М.
Rollup, Cube & Grouping - Practically in Oracle
7:43
Dr. Parag Shukla
Рет қаралды 3 М.
Oracle SQL:Dynamic Pivot
5:42
Elnur Sadiqov
Рет қаралды 4,9 М.
Oracle SQL - PIVOT Clause
18:53
Ora Trainings
Рет қаралды 12 М.
SQL: UNION ALL, ROLLUP and GROUPING SETS for sub-totals
26:11
Flex Your Data
Рет қаралды 908
SQL PIVOT & UNPIVOT simple explanation
10:24
Nivea's Tutorials
Рет қаралды 7 М.
Use PIVOT operator with your own concept in Oracle
11:29
Oracle Shooter
Рет қаралды 3,4 М.
PIVOT - Understanding the Basics in SQL
6:21
Teradata
Рет қаралды 30 М.
didn't manage to catch the ball #tiktok
00:19
Анастасия Тарасова
Рет қаралды 31 МЛН