Forum Replies Created

Viewing 15 posts - 136 through 150 (of 345 total)

  • RE: Trigger block problem

    Is there a question here, or is this just a demo of the most convoluted way possible to do table auditing?

  • RE: Question related to IN operator in where clause

    If your comma-separated lists are uniform, then you could search them like this

    select * from #Temp

    where ',' + Client_List + ',' like '%,9,%'

    But only you can know if it will...

  • RE: Mathematical Theory (controversy!)

    Came across this: http://i.imgur.com/dsCw0.gif

    As an ex-teacher, I love stuff like this that explains/shows the meaning behind these numbers and symbols.

  • RE: Columns and rows into one Column

    tripri (9/8/2011)


    But i'm getting an error when i execute this code

    Query:

    select name , ' Geo: ' + Geo + ' Sci: ' + Sci

    from name

    Error:

    Msg 245, Level...

  • RE: I need help copying data within 2 tables

    Add a new column in table1 called something like "DuplicateOf" which contains the uniqueidentifier of the row it was copied from. Now you can join table2 to this new column...

  • RE: Select where statement issue

    Salil-386686 (9/2/2011)


    Hi

    I think this would be a better bet

    select * from Form where FromID not in(3,4)

    Thanks

    Salil

    Clearly, this is the way to do it:

    select f.*

    from @form f left join

    (select...

  • RE: Please help with Query

    david 98157 (8/29/2011)


    I am running a query collecting data from multiple tables and connecting it to a master part number on the same row. The problem that i am running...

  • RE: Need help with cte or self Join

    What would be the logic to populate those values?

    Do you already have the columns defined?

    Is the start value a running total?

    That takes care of #2, but the important question being...

  • RE: Ordering with nulls

    Seconded. A good setup gets your question answered quickly. With tested code! 😎

  • RE: Ordering with nulls

    ColdCoffee (8/31/2011)


    This will be more robust:

    select ColA, ColB

    from TestTable

    order by isnull( ColA , ColB) ,

    case when ColA is not...

  • RE: Ordering with nulls

    Nice shot, CC. You got there seconds before me 😉

    select * from TestTable

    order by

    ISNULL(ColA, ColB) + ISNULL(ColB, ColA)

  • RE: CASE Statement to count non-nulls

    Case when ISNULL(Field1,0) = 0 then 0 else 1 end +

    Case when ISNULL(Field2,0) = 0 then 0 else 1 end +

    Case when ISNULL(Field3,0) = 0 then 0 else 1 end...

  • RE: unique problem with t-sql

    nairdeepa (8/30/2011)


    the only problem i see though i have not tried this.is that it might update everything..and i want only the last one to be updated

    Umm...when we say "try this"...

  • RE: unique problem with t-sql

    Give this a try:

    update a

    set order_attribution = 'Y'

    from TMPDATA a

    where

    mmc_vendor = 'email'

    and mmc_placement = '_bmui'

    and exists (

    select 1

    from TMPDATA b

    where

    b.session_start_time > a.session_start_time

    and b.mmc_vendor = 'free_search'

    )

  • RE: Loading Multiple files in to one table

    So far what i did is...I loaded all the 100 files into one table as a a single column using for each loop.

    You don't want to do this because now...

Viewing 15 posts - 136 through 150 (of 345 total)