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
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
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
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.
I need to transpose table either is SQL or Excel.
For example:
Thanks in advance
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.