SQL Query - Convert data from Rows to Columns | Pivot

SQL Query - Convert data from Rows to Columns | Pivot

Learn at Knowstar

4 года назад

178,406 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Babu N
Babu N - 06.04.2023 15:10

Hi great work ...!!
Can we have a entire course like video in converting the queries or stored procedures from oracle to ms sql

Ответить
Houston Firefox
Houston Firefox - 02.01.2023 19:06

Good video. Going forward and when producing education content, please refrain from using reserved words such as "Name" and "Value" in your SQL code. It makes me cringe when I see developers use reserved words as column names.

Ответить
TheRealGod
TheRealGod - 10.12.2022 14:29

Thank you ☺️

Ответить
Karthik J
Karthik J - 18.11.2022 22:52

hello mam, this is very helpful, however, was wondering if you have any video anywhere of yours on multiple pivot

Ответить
G Ashok
G Ashok - 29.10.2022 06:14

How to pivot a row word 'oracle'as column can anyone write syntax

Ответить
ruchi agrawal
ruchi agrawal - 22.09.2022 12:15

How to do this for both , and blank separator

Ответить
Rage against the caniche
Rage against the caniche - 30.05.2022 01:07

Hello. If someone can help --> What code lines need to be added in order to copy the result of this query into an other table of the database ? Many thanks !!!!

Ответить
ARUN V
ARUN V - 14.05.2022 06:50

does this wroks in sql workbench ?i guess pivot dont work in tat

Ответить
Hulkbai yo
Hulkbai yo - 19.04.2022 03:45

okay, tbh I think first method is easy to understand and use. but probably second one is common use. I just don''t like that pivot format

Ответить
Mil Loons
Mil Loons - 21.03.2022 22:01

Thanks, clear and concise tutorial.

Ответить
Ram Prasad
Ram Prasad - 07.03.2022 17:50

Thank you ma'am it is very helpful this pivot function for my automations

Ответить
ThePHnunes
ThePHnunes - 05.11.2021 21:45

How can i do that, when i want to show more than one row in that case? Example: I have a city name (collumn name) and in the rows i will put the name of the places. If i put MAX on the pivot, they show me only 1 row, but i need that they show me all the places... i need use another function, or pivot can attend me?

Ответить
bw424
bw424 - 31.08.2021 23:00

It's not ideal that you have to know the values to use as pivot table columns. What if you wanted to base it off a sequential order? Like have the top value as the first column, the second value as the second column, etc. That way you could grab the top results and pivot them in order. I think this would be pretty easy to do in pandas.

Ответить
JOE SYE'READI
JOE SYE'READI - 04.08.2021 15:38

Please help me,

what if i have 2 tables..

the first table contains: id, name, age,
the second tables contains : idage16, idage17,idage18 like this:

table 1 people table 2 age
---------------------------- -------------------------------------------------

id name age ideage16 ideage17 ideage18
---------------------------------------------------------- --------------------------------------------------------------------
1 joe idage16 90 80 70

the question is how can i get value in the third table like this

id name age point
-------------------------------------------------------------------
1 joe idage16 90

pliss help me for make videos...

Ответить
Shirish Shukla
Shirish Shukla - 04.07.2021 07:51

What does max function do here? Why was the aggregate needed?

Ответить
Jack Sparrow Capitan
Jack Sparrow Capitan - 09.05.2021 20:49

Your voice is attractive day by day Teacher !!!
Great content as always

Ответить
Ramesh K
Ramesh K - 09.05.2021 02:54

Please improve the Video quality, otherwise it is very good

Ответить
NIMMA NIGGA
NIMMA NIGGA - 27.04.2021 08:51

Select * from dbo.Emp

Select ID,[Name],[Gender],[salary]
from
(Select ID,Name as EName, Value
From dbo.Emp) as Source_Table
PIVOT
(Max(Value)
For
EName in ([Name], [Gender], [Salary])
) as Pivot_Table

Ответить
Sindhura Tridandapani
Sindhura Tridandapani - 21.04.2021 01:32

Hi . This video is informative. However, I am looking for a pivot function when there are all String columns . What aggregate function can we use for String column?

Ответить
miguel castillo
miguel castillo - 20.04.2021 20:57

Izi pizi to understand

Ответить
June Vu Tran
June Vu Tran - 14.04.2021 23:15

Thank you so much. This is what I am looking for

Ответить
MaXY
MaXY - 07.04.2021 11:09

You a genius

Ответить
Sneha Sneha
Sneha Sneha - 07.03.2021 13:00

Mam..Pls explain how to write the Pivot query if multiple records are present ...do we need to use partitions in the query ?

Ответить
AkhandBharat
AkhandBharat - 24.02.2021 13:00

But keep up the good work

Ответить
AkhandBharat
AkhandBharat - 24.02.2021 13:00

Need to work on the way you explain. It’s difficult to understand

Ответить
widze wisze
widze wisze - 11.02.2021 11:26

hi ! nice video thanks alot ;but what about N rows ? i mean in rows >3 ?

Ответить
santosh test
santosh test - 18.01.2021 11:35

Hi, can you provide your mail id , I have few queries.

Ответить
Dioscoro
Dioscoro - 25.11.2020 10:14

THIS JUST SAVE ME!! wew

Ответить
Sherri McDonald
Sherri McDonald - 12.11.2020 16:38

Thank you for this. I learned about a much needed function in order for me to build a ssrs report.

Ответить
hmukai001
hmukai001 - 05.11.2020 13:41

Went over many googled articles and they were filled with jargons and did not make any sense to me. After all that, I came across your clip and its solved all the mystery. Thanks for making it so simple to understand!

Ответить
Ciprian Zaharia
Ciprian Zaharia - 07.10.2020 21:52

Nice explanation

Ответить
pradeep kumar
pradeep kumar - 05.10.2020 22:53

It's very useful

Ответить
Dimpy Rathore
Dimpy Rathore - 25.03.2020 01:44

Wow. Didn't know about this function.

Ответить
Kristy Owens
Kristy Owens - 24.03.2020 17:50

Learned a new SQL function today - interesting. Thanks.

Ответить
Learn at Knowstar
Learn at Knowstar - 24.03.2020 17:13

We have received your SQL Queries asked in interviews and plan videos soon answering those.


If you wish to share some more, put them down in the comments below or send us an email!


Happy Learning with Learn At Knowstar!

Ответить