How to pivot rows to columns (and back) in SQL: Databases for Developers #14

  Рет қаралды 10,563

The Magic of SQL

The Magic of SQL

6 жыл бұрын

Sometimes you want to convert rows to columns. Or convert columns back into rows.
Luckily SQL has two clauses to help you do this:
PIVOT & UNPIVOT
Using these you can easily transform your rows to columns and back again.
Want more?
Take the course:
devgym.oracle.com/pls/apex/dg...
Read the blog post: blogs.oracle.com/sql/how-to-c...
Read the docs:
PIVOT: docs.oracle.com/en/database/o...
UNPIVOT: docs.oracle.com/en/database/o...
Need help with SQL? Ask us over on AskTOM: asktom.oracle.com
Twitter: / chrisrsaxon
Daily SQL Twitter tips: / sqldaily
All Things SQL blog: blogs.oracle.com/sql/
============================
The Magic of SQL with Chris Saxon
Copyright © 2015 Oracle and/or its affiliates. Oracle is a registered trademark of Oracle and/or its affiliates. All rights reserved. Other names may be registered trademarks of their respective owners. Oracle disclaims any warranties or representations as to the accuracy or completeness of this recording, demonstration, and/or written materials (the “Materials”). The Materials are provided “as is” without any warranty of any kind, either express or implied, including without limitation warranties or merchantability, fitness for a particular purpose, and non-infringement.

Пікірлер: 7
@kennethdavidson2106
@kennethdavidson2106 3 жыл бұрын
I've been watching all these videos over the last two days, and at this point "one day cake orgy" is by far the best thing I've heard in any database tutorial. Thank you for making this stuff straight forward.
@TheMagicofSQL
@TheMagicofSQL 3 жыл бұрын
Thanks, glad you enjoyed this!
@ashwinghorpade5917
@ashwinghorpade5917 4 жыл бұрын
Plz videos on ssis and performance tunning
@sanchitsingh7162
@sanchitsingh7162 5 жыл бұрын
Haha nice!
@TheMagicofSQL
@TheMagicofSQL 5 жыл бұрын
Thanks Sanchit :)
@pat834
@pat834 Жыл бұрын
Thanks though ‘any’ doesn’t work for me
@TheMagicofSQL
@TheMagicofSQL Жыл бұрын
Please post a complete example to asktom.oracle.com/ and we'll look into what the issue is
Union, Minus & Intersect: Databases for Developers #15
6:52
The Magic of SQL
Рет қаралды 4,5 М.
WHAT’S THAT?
00:27
Natan por Aí
Рет қаралды 12 МЛН
Does size matter? BEACH EDITION
00:32
Mini Katana
Рет қаралды 20 МЛН
Q2 2024 Eventide CIO Update
1:00:56
Eventide Asset Management
Рет қаралды 86
How to Pivot Your Data in T-SQL for SQL Server - Static and Dynamic Column Examples
13:00
Sean MacKenzie Data Engineering
Рет қаралды 3,1 М.
Null: Databases for Developers #10
7:42
The Magic of SQL
Рет қаралды 11 М.
T-SQL Tutorial - PIVOTing Made Easy
21:28
BeardedDev
Рет қаралды 10 М.
How to Create Database Indexes: Databases for Developers: Performance #4
12:47
What are Optimizer Statistics? Databases for Developers: Performance #2
11:19
Hierarchical SQL Queries: Databases for Developers #16
9:38
The Magic of SQL
Рет қаралды 61 М.
Oracle Pivot with group total computation
13:41
Siva Academy
Рет қаралды 23 М.
SQL Unpivot and more
14:45
James Oliver
Рет қаралды 12 М.
ГОСЗАКУПОЧНЫЙ ПК за 10 тысяч рублей
36:28
Ремонтяш
Рет қаралды 491 М.
OZON РАЗБИЛИ 3 КОМПЬЮТЕРА
0:57
Кинг Комп Shorts
Рет қаралды 1,9 МЛН
ОБСЛУЖИЛИ САМЫЙ ГРЯЗНЫЙ ПК
1:00
VA-PC
Рет қаралды 2,1 МЛН
Top 50 Amazon Prime Day 2024 Deals 🤑 (Updated Hourly!!)
12:37
The Deal Guy
Рет қаралды 1,4 МЛН
Копия iPhone с WildBerries
1:00
Wylsacom
Рет қаралды 367 М.