Forum Replies Created

Viewing 15 posts - 871 through 885 (of 1,420 total)

  • Reply To: How to check if NextDay is Holiday (exclude Saturday and Sunday)?

    Just a note about the table design.  For this purpose all of the rows which are not a holiday are irrelevant.  Meaning if there were a table of just holidays...

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: Ignore the entire record if a matching record is found

    select distinct a.KeyId
    from applications a
    where not exists (select 1
    from...

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: How to check if NextDay is Holiday (exclude Saturday and Sunday)?

    Here are two ways depending on whether GETDATE() returns the date you're interested in.  If it does you could use something like this

    /* use GETDATE() to determine...

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: Are the posted questions getting worse?

    Eirikur Eiriksson wrote:

    My "favourite" response ever for that question is "do you mean now?"

    We're in now now

    https://www.youtube.com/watch?v=nRGCZh5A8T4

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: Are the posted questions getting worse?

    Jeff Moden wrote:

    "How do you get the current date and time using T-SQL question that 20 out of 22 candidates couldn't answer before I stopped counting.  It's NOT a trick question,...

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: Where do I start from ?

    There's a documented process for submitting performance issues.  In the footer of Jeff Moden's forum posts there's a link.

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: How to use PIPES in T-SQL to bring two number based on user entry

    Here's some code to test for what works

    declare
    @number1 varchar(12)='121',
    @number2 varchar(12)='126';

    select top(1) tp.number, tp.username
    from (values ('4581265', 'J'), ('14121587', 'K')) tp(number, username)
    where tp.number like '%'+@number1+'%'...

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: How to use PIPES in T-SQL to bring two number based on user entry

    Could each user entered number be assigned to a different variable?   If you have number1 and number2 then something like this

    select top(1) tp.number, tp.username, ...
    from tb_phone tp
    where...

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: How to create a minimal tally table and to describe its advantages (if any)

    Recall the hamburger analogy.  If the OP has eaten McDonalds before my gourmet burger is ready then they won't be hungry when it arrives.

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: How to create a minimal tally table and to describe its advantages (if any)

    That's not how long the SQL code takes to execute.  Tally based method would crush the OP's kludge especially as their test case is  spanning thousands of days.

    19 minutes is...

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: How to create a minimal tally table and to describe its advantages (if any)

    Jeff Moden wrote:

    Would you PLEASE post the actual test that you did on the first one we were talking about before moving on to another.

    Yes, sorry.  This is the preferred answer. ...

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: How to create a minimal tally table and to describe its advantages (if any)

    Jeff Moden wrote:

    Steve Collins wrote:

    Here's another one.  It took 19 minutes vs 12 minutes for the rCTE.  There's no sample data and no time for making any up.  Hopefully the query is...

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: How to create a minimal tally table and to describe its advantages (if any)

    Here's another one.  It took 19 minutes vs 12 minutes for the rCTE.  There's no sample data and no time for making any up.  Hopefully the query is sound.  It...

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: How to create a minimal tally table and to describe its advantages (if any)

    jcelko212 32090 wrote:

    Any time I've needed to populate a table of sequential numbers, I just done it by brute force. No recursion or fancy stuff. Remember the definition of place valued...

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Viewing 15 posts - 871 through 885 (of 1,420 total)