transpose in SQL - sql

Can I transpose results in SQL just like I have it in excel. No hard coded values as I have different results every time.
For example, I have a table of employees and I want it to just convert rows into columns and columns into rows.
Thank you.

Related

Maria DB how to format my sql statement to pull data from my table(s) into cells based on values in column and keywords in rows

Been a minute since I did SQL programming. I have a large table that can be broken up into several tables.
What I need is where date and keyword row, put the "integer" in the cell. So I have the different years (not sequential, like 1950, 1956, 1958, 1961 ...) going across the top, keywords defining the rows and the integer in the cells.
And what is the best way to sort the columns in date order oldest to the newest. Different quantities of dates for each report.
Thanks

combine multiple rows into one row based on column value

IS there a way in SQL to make multiple rows for a common column, show up in one?
For example I would like this output:
to show up as:
I believe this article contains solutions to your question -
SQL Query to concatenate column values from multiple rows in Oracle

Is there a query to get all the columns between 2 columns?

I have a table with >50 columns. I have the names of two columns. However, I would like to sum the values of these 2 columns as well as all the columns between them (>50). It seems very impractical to type all the column names in a sum statement. Is there a query for this? I am using SQL Impala by the way.

Transpose table for multiple rows

I need to transpose table either is SQL or Excel.
For example:
Thanks in advance

How can I pass multiple rows to a columns in sql?

I have this table
I need to pass the rows of the column brothers to others columns, like this.
how can I do it?
I think that I can't use the function PIVOT because I don't know how many rows there will be. and i can't set a limit for the number of rows.