Forum Replies Created

Viewing 15 posts - 3,406 through 3,420 (of 3,957 total)

  • RE: Unpivoting Data

    vinu512 (6/15/2012)


    Hi Chris and Dwain.....this is really sweeet. 😀

    You should see it vs. the double UNPIVOT. IMHO much cleaner. Runs faster too.

  • RE: Unpivoting Data

    anthony.green (6/15/2012)


    Thanks guys, much appreciated. Was racking the brain yesterday on that and for the life of me couldnt get unpivot working.

    I like the idea of the values list,...

  • RE: Need Help in Query

    Jeez Kingston, you've let the cat out of the bag!!

    Actually you don't need to do a JOIN of any sort.

    create table #studentSchoolHistory (studentID varchar(12),scode int, iSchoolYearcode int)

    insert into #studentSchoolHistory values...

  • RE: How to query results in debit and credit column

    Lynn Pettis (6/15/2012) Now I am wondering if this was also a homework problem.

    SELECT SolutionFor

    FROM MyHomework

    WHERE Solutionby = 'Lynn' OR Solutionby = 'Sony'

    🙂

  • RE: Need Help in Query

    Lynn Pettis (6/15/2012)


    dwain.c (6/14/2012)


    INNER JOIN student with studentSchoolHistory tables to get the first 3 columns. Use a correlated subquery to get the fourth (Mobility Indicator) column.

    Oh, actually a left...

  • RE: How to query results in debit and credit column

    Lynn Pettis (6/14/2012)


    Not sure why you need the SUM or GROUP BY.

    I was going to say the same thing but I think Sony was assuming there might be duplicated rows...

  • RE: Trim String

    Sony Francis @EY (6/14/2012)


    Try this

    SELECT PARSENAME(REPLACE('/Folder/File/Name', '/', '.'), 2)

    Looks familiar! 😉

  • RE: need help in Database design

    I think your friend's suggestion is appropriate.

    If you're worried about having 500000 rows in the role/screens table, try only storing the relation if the role is authorized to use the...

  • RE: Trim String

    This will also work.

    SELECT PARSENAME(REPLACE('/Folder/File/Name', '/', '.'), 1)

  • RE: Blocking

    I would start by putting a WITH(ROWLOCK) hint on the UPDATE statement.

  • RE: Need Help in Query

    INNER JOIN student with studentSchoolHistory tables to get the first 3 columns. Use a correlated subquery to get the fourth (Mobility Indicator) column.

  • RE: T-SQL Problem

    It appears that there is more than one person stumped on the same homework problem:

    http://www.sqlservercentral.com/Forums/Topic1316272-391-1.aspx?Update=1

  • RE: Need Help in Query

    It appears that there is more than one person stumped on the same homework problem.

    http://www.sqlservercentral.com/Forums/Topic1316131-391-1.aspx

  • RE: Unpivoting Data

    ChrisM@home (6/14/2012)


    Have you tried a VALUES list? With CROSS APPLY?

    Gosh Chris! Did you mean like this?

    SELECT APUserID, TypeID, Something

    FROM @SampleData

    CROSS APPLY (

    VALUES ('FirstName', FirstName)

    ...

  • RE: Simple select by max date

    Lynn Pettis (6/14/2012)


    dwain.c (6/14/2012)


    Sean Lange (6/14/2012)


    One requirement of a CTE is the previous line must end with a semicolon. As such many people have developed the habit of beginning a...

Viewing 15 posts - 3,406 through 3,420 (of 3,957 total)