Forum Replies Created

Viewing 15 posts - 406 through 420 (of 466 total)

  • RE: CONVERT COLUMN VALUES TO COMMA SEPARATED ONE ROW VALUE..

    ;with SampleDataR as

    (

    select *, ROW_NUMBER() over (partition by title, subtitle order by value) rownum

    from test12

    )

    select distinct title, subtitle,(

    select value

    + case when s1.rownum = (select MAX(rownum) from SampleDataR where...

  • RE: Tsql grouping question

    I have used for xml path to do a similar thing before.

    ;with SampleDataR as

    (

    select *, ROW_NUMBER() over (partition by ID order by Name) rownum

    from #Temp

    )

    select distinct ID,(

    select Name

    +...

  • RE: Return all members of a group if one member matches

    I'm sure there's 100 different ways to do this, most of which are better than my solution, but here it is anyways.

    select j1.child

    from job j1

    where j1.parent in (

    select j.parent

    from sites...

  • RE: What's triggering the error?

    If you only want the rows where the score is between 1 and 10, I would just replace you where statement with something like this.

    WHERE score like '[1-9]' or score...

  • RE: Confusing convert statement result

    I guess I was wondering if there is some documentation on this behavior. What I found and posted wasn't very satisfying to me. I know it can be...

  • RE: Confusing convert statement result

    ColdCoffee (2/21/2012)


    ISNUMERIC will accept and approve decimals, dollar symbol and commas as valid characters! So dont belive ISNUMERIC always.

    This MSDN link has a lot of information on ISNUMERIC.Read them up!

    And...

  • RE: sql query count function

    ColdCoffee (2/20/2012)


    This (actually, the solution posted by Rory)

    DECLARE @Table TABLE

    ( UserID INT , Interested INT

    , Interesting INT , Purchased INT )

    INSERT INTO @Table (UserID ,Interested, Interesting,...

  • RE: sql query count function

    If they're all just 1 or 0 flags for each category, just use the SUM() function on each column to get the count that are interested, purchased, ect.

  • RE: List first one in each group

    select specialty, MIN(providerid)

    from TestProviders

    group by specialty

  • RE: how to remove trailing zeros from zip codes

    If you are sure you want all the zips length greater than 5 then something like this should work.

    update p

    set p.zip = substring(p.zip, 1, 5)

    from person p

    where len(zip) > 5

    You...

  • RE: how to remove trailing zeros from zip codes

    sbarlow (2/13/2012)


    If i run this select * from person WHERE len(zip) > 5 I get this result what I need is an update statement to remove the zeros

    134930000

    134930000

    134930000

    134930000

    134930000

    134930000

    134930000

    134930000

    134930000

    134930000

    134930000

    134930000

    134930000

    Try

    select substring(zip,...

  • RE: how to remove trailing zeros from zip codes

    Are they all 9 digits long and all have 4 zeros at the end? If so,

    substring(zip, 1, 5)

    would work. If you post some code with some sample data...

  • RE: Talking baseball

    Ray K (2/13/2012)


    So, the Seattle Mariners have started camp! I understand that other teams open camp this week as well!

    So, who's excited? :hehe:

    The Cubs are tied for first place...

  • RE: 40,000 Database Nightmare

    Divine Flame (2/8/2012)


    tototom (2/8/2012)


    For those who wonder what happened to me. We lived with the nightmare for years. Backing up, restoring, application updates, etc. were all major problems.

    Finally after...

  • RE: Increment column from 1-10 in select statement, tally or simple ROW_NUMBER?

    Ah, sorry about that. That and Howard's solution make sense now.

Viewing 15 posts - 406 through 420 (of 466 total)