How to show row data to vertical data(columns) please

Good Morning,
Could you please help with this
I have a table with following two columns
TechName  Version
SQLServer 2000
SQLServer 2003
SQLServer 2005
SQLServer 2008
SQLServer 2008R2
Oracle    11G
MSOffice 2000
MSOffice 2003
MSOffice 2007
MSOffice 2010
How can i show version column this data as vertical component 1 to 5
TechName Component1 Component2 Component3 Component4   Component5
SqlServer     2000             2003               2005            
2008                2008R2
Oralce          11G              NULL               NULL             
NULL               NULL
MSOffice       2000            2003               2007             
2010                NULL
Please Help me  with this
Thank you in Advance
Asita

This operation is known as pivoting. The common way to pivot data (transpose rows to columns) in T-SQL is:
- Grouping (GROUP BY)
- Spreading values (CASE expression)
- Aggregating (MIN / MAX / COUNT / etc.)
Since you have different versions, depending on the value of TechName, then it will be easier if we enumerate each version per value of TechName (row_number in this case).
with C as (
select *, row_number() over(partition by TechName order by version) as rn
from T
select
    TechName,
    max(case when rn = 1 then Version end) as Component1,
    max(case when rn = 5 then Version end) as Component5
from
    C
group by
    TechName;
If you are going to have more than 5 versions for specific TechName and you do not want to put a quota, then you will have to reach to dynamic sql. Search in this forum by "dynamic pivot" and you will find plenty of examples.
AMB
Some guidelines for posting questions...
AYÚDANOS A AYUDARTE, guía básica de consejos para formular preguntas

Similar Messages

  • How to show a data in Higher fonts with write statement

    Hi.
    how to show a data in Higher fonts with write statement
    I want to show a statement in large fonts with write statement.How can I do that.
    write : 'Company Address'.
    Regards
    Mave

    Mave,
      I would precribe you to use the FORMAT options available with the WRITE Statement.
    Because this allows us to differentitate between the HEADIngs and the LINEs in the report.
    Here u go dear:
      http://help.sap.com/saphelp_47x200/helpdata/en/9f/db9e7135c111d1829f0000e829fbfe/frameset.htm
    Thanks
    Kam

  • How to show only date in BO webi 3.1 text box

    how to show only date in BO webi 3.1 text box for e.g:-
    01/01/2005  (no time only date)

    hi,
    just check by which format your date is coming
    just create a one variable and check =UserResponse("Transaction Date From (mm/dd/yy)")
    if your output is in format of("mm/dd/yyyy hh:mm:ss a")
    then some format we have to write in todate syntax
    then your final formula for date would be
    =FormatDate(ToDate(UserResponse("Transaction Date From (mm/dd/yy)");"mm/dd/yyyy hh:mm:ss A");"dd/mm/yyyy")

  • How to add one date column and charecter column

    hi all,
    i have 3 column start_date(date),end_date( date),duration (varchar2)
    i am trying to add start_time and duration like this
    end_date := to_char(start_time) + duration;
    but its showing value_error
    how to add one date column and charecter column.
    Thanks

    you need something that does:
    end_date (DATE) := start_date (DATE) + <number of
    days> (NUMBER)Not necessarily, because if the duration is just a string representation of a number then it will be implicitly converted to a number and not cause an error
    e.g.
    SQL> ed
    Wrote file afiedt.buf
      1  with t as (select to_date('01/07/2007','DD/MM/YYYY') as start_dt, '3' as duration_days from dual)
      2  -- END OF TEST DATA
      3  select start_dt + duration_days
      4* from t
    SQL> /
    START_DT+
    04-JUL-07

  • How to fetch the Date column(or Month column) from the file name from the specified path in ODI 11g

    Hi ALL,
    Can any one help us regarding How to fecth the Date column(or month column) from the file name specified in the path in a generalized way .
    For example :
    file name is :subscribers (Cost) Sep13.csv is specified in the below path
      E:\Accounting\documents\subscribers (Cost) Sep13.csv
    here I need to fetch the "Sep13" as a Date column in the ODI 11g in the generalized way.
    Can any one help us in this case as early as possible.

    I would suggest using a piece of Jython code for this.  Something like this...
    import os
    import os.path
    filelist  = os.listdir(E:\Accounting\documents\)
    for file in filelist:
    datestr = file[19:-4]
    You'd need to work out what to do with datestr next...  perhaps write it to a table or update an ODI variable with it.
    Hope this is of some help.

  • Time of email shows in Date Column, Date is not showing on new emails

    Date is not showing in Date column. Only time is showing.
    I just migrated from OE - Old emails show the time & Date.

    If these are emails received today that is normal. Thunderbird assumes you know what day it is and only displays the time for messages received today. It will append the date to these messages at midnight tonight.

  • I'm actually trying to find the date i visited a site. adding columns allow the order to be sorted but not show a date. Please tell me it there's a way to see t

    I'm actually trying to find the date i visited a site. adding columns allow the order to be sorted but not show a date. Please tell me it there's a way to see the date. the sidebar no longer has the option for date. the most recent only shows the time.

    If you only see the time then that would mean that you see an entry of the current day (today).
    History items from past days should have the date as well in the Most Recent Visit column.
    You should be able to see this changing if you open the last 7 days folder and scroll down.

  • How to show datagridview data in pdf

    Dear all
    I have a windows form application and want that datagridview data to get in pdf how to do that using itext or any other pdf dll

    Dear all
    I could sort out my problem. I made little changes in my codes and now without creating database I could create pdf file. For others to know I am submitting my codes below for study and for more improvements if needed.
    Option Strict On
    Option Explicit On
    Imports System
    Imports iTextSharp.text
    Imports iTextSharp.text.pdf
    Imports System.IO
    Public Class Form1
    Dim dsPeople As New DataSet("People")
    Dim dt As New DataTable
    WithEvents bsData As New BindingSource
    Dim counter As Integer
    Dim Total As String
    Dim TrueTypeFont As Object
    Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
    Try
    ' code for First Row
    Dim Bonus = (CDbl(ComboBox2.SelectedItem) * CDbl(TextBox2.Text) * 0.001)
    Dim SumAssured = TextBox2.Text
    Dim NormalCover = CDbl(TextBox2.Text) + Bonus
    Dim DAB = (CDbl(CStr(TextBox2.Text)) * 2)
    Dim Premium = TextBox4.Text
    Dim Tax = (CDbl(TextBox4.Text) * CDec(ComboBox1.SelectedItem) * 0.01)
    Dim Net_outgo = CDbl(CDbl(TextBox4.Text) - Tax)
    Dim AccBenefit = DAB + Bonus
    Dim Return_From_LIC = CStr(0)
    dt.Rows.Add(New Object() {TextBox1.Text, CStr(NormalCover), CStr(AccBenefit), Premium, CStr(Tax), CStr(Net_outgo), CStr(Return_From_LIC)})
    ' code for Second to second Last Row
    For Me.counter = 0 To CInt((CDbl(TextBox3.Text) - 2))
    TextBox1.Text = CStr(CDbl(TextBox1.Text) + 1)
    NormalCover = CDbl(CStr(NormalCover + Bonus))
    AccBenefit = CDbl(CStr(AccBenefit + Bonus))
    Premium = TextBox4.Text
    Tax = CDbl(TextBox4.Text) * CDec(ComboBox1.SelectedItem) * 0.01
    Net_outgo = CDbl(CDbl(TextBox4.Text) - Tax)
    Return_From_LIC = CStr(0)
    dt.Rows.Add(New Object() {TextBox1.Text, CStr(NormalCover), CStr(AccBenefit), Premium, CStr(Tax), CStr(Net_outgo), CStr(Return_From_LIC)})
    Next
    ' Code of Last column
    TextBox1.Text = CStr(CDbl(TextBox1.Text) + 1)
    NormalCover = CDbl(CStr(NormalCover + Bonus))
    AccBenefit = CDbl(CStr(AccBenefit + Bonus))
    Premium = CStr(0)
    Tax = CDbl(CStr(0))
    Net_outgo = CDbl(CStr(0))
    Return_From_LIC = CStr(CDbl(TextBox2.Text) + Bonus * CDbl(TextBox3.Text))
    dt.Rows.Add(New Object() {TextBox1.Text, CStr(NormalCover), CStr(AccBenefit), Premium, CStr(Tax), CStr(Net_outgo), CStr(Return_From_LIC)})
    ' Code of Summary column
    TextBox1.Text = "Total"
    NormalCover = Nothing
    AccBenefit = Nothing
    Premium = CStr(CDbl(TextBox4.Text) * CDbl(TextBox3.Text))
    Tax = CDbl(TextBox4.Text) * CDec(ComboBox1.SelectedItem) * 0.01 * CDbl(TextBox3.Text)
    Net_outgo = CDbl(CDbl(CDbl(TextBox4.Text) - (CDbl(TextBox4.Text) * CDec(ComboBox1.SelectedItem) * 0.01)) * CDbl(TextBox3.Text))
    Return_From_LIC = CStr("-")
    dt.Rows.Add(New Object() {TextBox1.Text, CStr(NormalCover), CStr(AccBenefit), Premium, CStr(Tax), CStr(Net_outgo), CStr(Return_From_LIC)})
    DataGridView1.DataSource = dt
    TextBox1.Text = Nothing
    TextBox2.Text = Nothing
    TextBox3.Text = Nothing
    TextBox4.Text = Nothing
    ComboBox1.SelectedItem = Nothing
    ComboBox2.SelectedItem = Nothing
    Catch ex As Exception
    MsgBox("Check Your Input Values")
    End Try
    End Sub
    Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
    ' Fill in the data grid on form load.
    'GetCustomers()
    dt = dsPeople.Tables.Add("dtPeople")
    'create table columns
    dt.Columns.Add("Age", GetType(String))
    dt.Columns.Add("Natural Cover", GetType(String))
    dt.Columns.Add("Accidental Cover", GetType(String))
    dt.Columns.Add("Premium", GetType(String))
    dt.Columns.Add("Tax Rebate", GetType(String))
    dt.Columns.Add("Net Outgo", GetType(String))
    dt.Columns.Add("Return From LIC", GetType(String))
    Me.DataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells
    End Sub
    Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
    Dim bHasErrors As Boolean = False
    Dim ErrorMessage As String = ""
    Dim FileName As String = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Customers.pdf")
    Dim Document As Document = New Document '(iTextSharp.text.PageSize.LETTER, 50, 10, 10, 10)
    Try
    PdfWriter.GetInstance(Document, New System.IO.FileStream(FileName, System.IO.FileMode.Create))
    Document.Open()
    Document.NewPage()
    Document.Add(New Paragraph("Hello World", FontFactory.GetFont("Arial", 20, BaseColor.BLACK)))
    Dim ch As New Chunk("Your Policy Presentation ", FontFactory.GetFont("Arial", 15, BaseColor.BLACK))
    Document.Add(ch)
    Dim aTable As PdfPTable
    aTable = New PdfPTable(dt.Columns.Count)
    For Each col As DataColumn In dt.Columns
    aTable.AddCell(col.ColumnName)
    Next
    Document.Add(aTable)
    For Each row As DataRow In dt.Rows
    aTable = New PdfPTable(dt.Columns.Count)
    aTable.AddCell(row.Field(Of String)("Age"))
    aTable.AddCell(row.Field(Of String)("Natural Cover"))
    aTable.AddCell(row.Field(Of String)("Accidental Cover"))
    aTable.AddCell(row.Field(Of String)("Premium"))
    aTable.AddCell(row.Field(Of String)("Tax Rebate"))
    aTable.AddCell(row.Field(Of String)("Net Outgo"))
    aTable.AddCell(row.Field(Of String)("Return From LIC"))
    'aTable.AddCell(row.Field(Of String)("Identifier"))
    Document.Add(aTable)
    Next
    Catch de As DocumentException
    bHasErrors = True
    ErrorMessage = de.Message
    Catch ioe As System.IO.IOException
    bHasErrors = True
    ErrorMessage = ioe.Message
    End Try
    Document.Close()
    If bHasErrors Then
    MessageBox.Show("Failed to create document" & Environment.NewLine & ErrorMessage)
    Else
    MessageBox.Show("The document" & Environment.NewLine & FileName & Environment.NewLine & "has been created")
    End If
    Process.Start(System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Customers.pdf"))
    End SubEnd class
    now this is full fledge program which produce pdf and open directly as a presentation image of created pdf is also attached.

  • How to show all data when using more than one parameter?

    Hi All,
    I used a query like this to show the data in a report:
    select col1, col2 // col1 and col2 are columns of tabale tab1
    from tab1
    where
    tab1.col1 =
    (case when :P_COL1 IS NOT NULL then // :P_COL1 IS A USER PARAMETER TO EQUAL COL1
    :P_COL1 ELSE tab1.col1
    end)
    AND TAB1.COL3 =
    (case when :P_COL3 IS NOT NULL then // :P_COL3 IS A USER PARAMETER TO EQUAL COL3
    :P_COL3 ELSE tab1.col3
    end)
    The problem is when I run the report with paramters values or not, It shows the data which is not null for both col1 and col3.
    That is when the value of col1 or col3 is null the report would not return that record!
    I want the report to show all data not only values which is not null!
    How to do this?

    Rainer,
    That where clause will fail when col1 in the table is null and the parameter has the dummy value. Consider the following:
    variable p_col1 varchar2
    exec :p_col1 := 'yourdummyvalue';
    select
    from
         select 'yourdummyvalue' col1 from dual
         union all
         select 'other' from dual
         union all
         select null from dual
         union all
         select 'X' from dual
    ) tab1
    where nvl(tab1.col1,'yourdummyvalue') = nvl(nvl(:p_col1,tab1.col1),'yourdummyvalue')In this case, the query returns the row with null and the row with 'yourdummyvalue', where only the row with 'yourdummyvalue' should be returned.
    You must do something like this:
    where ( :p_col1 is null or ( :p_col1 = tab1.col1 ) )That one is the simplest and does not need a dummy value. Here are some other more complicated examples:
    where nvl( :p_col1, 'yourdummyvalue' ) = decode( :p_col1, null, 'yourdummyvalue', tab1.col1 )or this:
    where nvl( :p_col1, 'yourdummyvalue' ) = nvl2( :p_col1, tab1.col1, 'yourdummyvalue' )In the last 2 cases, it will not matter if the dummy value exists in the data, but they are unnecessarily complex.
    Kurz

  • How to show delivery date in Bex Analyzer

    Hi Gurus!
    I have to create a report in logistic scenario and my client wants that the report shows a column with the "Scheduled delivery date". I don't know how to show it in a column because in my KF structure, I can't put just this time characteristic.
    Does anybody know how can I solve it?
    Many thanks!

    Hi,
    Create a Formula Variable on Scheduled  DeliveryDate with processing as replacement path, replace variable with InfoObject, replace with Key and use it in the new formula in the columns.
    in this way query designer will accept you to use the char as in column,
    hope it helps you.
    Regards
    Reddy A

  • GeoMap Point Theme: how to get row data in a click listener?

    How can I get data (short of latitude, longitude, label and value) for a clicked FOI point from an iterator in a point theme click listener?
    In a bar/pie theme I can set location column to be the primary key column, and then in a listener do something like
    public void myClickListener(MapClickActionEvent mapClickActionEvent) {
        DataContent data = mapClickActionEvent.getDataContent();
        GeoRowObject row = data.getGeoRowObject();
        GeoObject key = row.getKey();
        Integer ID = Integer.valueOf(key.getLocation());
        // Use our ID to get data from an iterator
    But there's no such thing as a location column in the mapPointTheme.

    sorry ..I am using Jde11g
    and the reason i am using trinidad is ,I want checkbox option to select ,unselect multiple row .
    Even i also tried by adding one column with checkbox in ADF table but no success regarding same i also post question on thread but no any positive reply
    Problem with af:selectBooleanCheckbox added in ADf table's Column
    Edited by: JaydeepJ on Aug 12, 2009 3:06 AM

  • How to retrieve row data from a  table

    Hey,
    Have a table with data and each row has one column which is a button. How do I retrieve the corresponding data of the row in which the button was clicked. Meaning what do I need to do differently in the table and what type of javascript on an onclick event etc would I need to get the data. If there is a better or simpler approach im open to any suggestions.
    Thanks in advance for your assistance
    e.g.
    <table>
    <tr>
    <td>column1 data</td><td>column 2 data</td><<input type="button" value="select" onclick="?????"/>
    </tr>
    </table>

    In the onclick event submit the jsp with query string.
    <onclick="process.do?rowId=<%=column1 data%>">
    have column 1 data as a unique identifier. Using request.getParameter get the column1 data value and query the db again to fetch the whole row data. I guess, it will work.

  • How to show grouped data in the same table?

    Hi,
    I am using JDev 11.1.1.2.0 with ADF 11g.
    I have a below requirement
    I have a tbl as below
    Columns -==> RC TL Code
    Data ==> 0 0 Prof
    0 1 Prin
    0 2 Tech
    1 0 Prin
    1 2 Prof
    I prepared a query with a grouping on TL so that I can show my data as below
    TL - 0
    RC Code
    0 Prof
    1 Prin
    TL - 1
    RC Code
    1 Prin
    TL - 2
    RC Code
    0 Tech
    2 Prof
    Really confused on to what type of component should I use and how can the component be repeated once dragged and dropped onto the canvas. Is this possible using ADF? If not what is the alternative?
    Thanks in advance.

    Hi Bharat,
      Unload the Repository and Delete the Table and fields in Hierarchy table and Recreate and reload the data.OIther wise you have to lot of manual work.
    Thanks
    Ganesh Kotti

  • How to show specific data for user on redirected page once they logged in

    I and fairly new, but have a general understanding of Dreamweaver. Using CS3 or CS4, how do you get the redirected page after the user logges in to show only the data for that user? I have creater the login page and it works fine but i dont know what needs to be on the redirected page for it to show only the data for the user that just logged in.
    I am not very good with the coding part so if it requires it any help with that would also be helpful.
    thank all.

    I should be able to get the understanding if explained.
    As for scripting i believe its PHP. at lease thats the page i created the login page with.
    As for user-specific information: basiclly there account information.
    As for database i have dreamweaver linked to a MySQL database. it pulls from 2) tables
    1st table has the following: ID - User Names - Password  - account number
    2nd table has the following: ID - account number - names - address - ect
    So basiclly i want when a user loges in for it to redirect them to a page which then only shows the data for that users. if i can link the data the pulls up by the account number that would be ideal
    Thank you Murry

  • How to show the data in table format when user click the Graph

    Hi,
    I have a graph in my report. If user click the graph is there a way to show
    the data behind it?
    Thanks.
    Regards,
    Jun

    Hi All,
    Any idea how to do this?
    Thanks.
    Jun

Maybe you are looking for