SQL Server Performance

Pivot Query

Discussion in 'SQL Server 2005 General Developer Questions' started by ajitgadge, Sep 29, 2009.

  1. ajitgadge New Member

    I wanted to write one query. Below is source table look likeuserid column0 column11 username john@yahoo.com1 firstname John1 lastname mathew2 username sasha@gmail.com2 firstname sober2 lastname sellorOutput look likeuserid username firstname lastname1 john@yahoo.com John mathew2 sasha@gmail.com sober sellorPlease let me know how do i get this above result set in one query.
  2. Adriaan New Member

    Well, you know the keyword already, so why aren't you checking Books Online?
    It's not the nicest syntax - for Jet, MS came up with the very elegant TRANSFORM syntax that is much easier to use.
  3. ajitgadge New Member

    Thanks for replyBut Can you please tell me how do i write this ?
  4. arunyadav Member

    Hello Ajit,
    Try this link: http://www.mssqltips.com/tip.asp?tip=1019
    From your post i was unable to get what column what value. send it in a tabular format if you want me to try writing this query for you.
  5. satya Moderator

Share This Page