Forum Replies Created

Viewing 15 posts - 3,811 through 3,825 (of 3,956 total)

  • RE: Recursive CTE for Item supersession question

    One caveat however, is the filter is going to be an issue since this will span across some 50k items. I just used this as a sample set :). I...

  • RE: Recursive CTE for Item supersession question

    My apologies Mr. Celko but I disagree with you, not on the grounds that you're applying MySQL to a SQL Server problem, but rather to agree with the OP that...

  • RE: Count Data in Large Seprated Text

    Lynn,

    Not really true. What if someone comes along and sees some code that will work for their task, but doesn't realize that the code they copied is inefficient for the...

  • RE: Count Data in Large Seprated Text

    Jeff,

    Thanks for the compliment even if it was a bit hesitant.

    You can't blame me for wanting to have a bit of fun with this one as I'm still in my...

  • RE: Question on Pitvoting data in SQL

    Ooops.. Bad idea... Never mind.

  • RE: Count Data in Large Seprated Text

    Thanks Jeff. Thought I had a brain freeze there.

    If you like truly cryptic solutions that can lead to job security, you may want to consider this:

    DECLARE @l TABLE (ID...

  • RE: Count Data in Large Seprated Text

    I must be missing something here... Like why is a split string function needed at all?

    DECLARE @l TABLE (ID INT, [Name] VARCHAR(30), Location VARCHAR(100))

    INSERT INTO @l (ID, [Name], Location)

    SELECT 1,...

  • RE: Help with an IF ELSE statement

    If you don't need @period for anything, you can do it this way.

    declare @end datetime

    declare @start datetime

    set @start = '2011-01-12 19:59:00.000'

    IF DATENAME(dw, @start) IN ('Sunday')

    select @start = DATEADD(Day, DATEDIFF(Day, 0,...

  • RE: BETWEEN ages

    THANK YOU ALL !!, it's working this way:

    DECLARE @minage INT

    DECLARE @maxage INT

    SET @minage = @FromAge

    SET @maxage = @ToAge

    if @minage > @maxage set @minage = @maxage + @minage

    if...

  • RE: Repeat and Unique customers at multiple locations

    Also, I think your repeat counts are wrong.

    --LocCustomers(Visits)

    --11(2), 2(2)

    --21(1), 3(2), 4(1)

    --31(1), 3(1), 4(2), 5(3)

    So now, counting repeats I get:

    Loc Repeats

    1 2

    2 1

    3 ...

  • RE: Repeat and Unique customers at multiple locations

    If I may, I'd like to ask a question as I've taken an interest in this problem.

    If I construct a list of locations, and assign to it the customers that...

  • RE: Pivot Like Report for Excel

    Phil,

    I am no expert with Dynamic SQL as I try to avoid it. However I realized early on that you might want to do something like that. The...

  • RE: TRimming of data froma record

    Bad data? When do we ever store bad data in our databases?

    Might work if you changed all data to data+'__' though.

  • RE: Pivot Like Report for Excel

    I found myself with some unexpected time on my hands this morning, so here is the solution decomposition. Note that I've slightly changed the code in a couple of...

  • RE: TRimming of data froma record

    Old or new, this is pretty easy:

    DECLARE @d TABLE (data VARCHAR(max))

    INSERT INTO @d (data)

    SELECT 'AIT_FIT_projecto and moonbeat'

    UNION ALL SELECT 'AIT_FIT_projectofile where handled'

    UNION ALL SELECT 'AIT_FIT_pritibabe every way'

    SELECT SUBSTRING(data, 1, CHARINDEX('_',...

Viewing 15 posts - 3,811 through 3,825 (of 3,956 total)