Forum Replies Created

Viewing 15 posts - 1,171 through 1,185 (of 1,413 total)

  • Reply To: Excecute dynamic

    According to the timestamps you answered your own question half a day before it was even asked!

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

  • Reply To: binary tree

    You could create a table (b_tree) to store your numeric data in a single column.  Then assign additional columns based on common attributes of the numbers.

    column1: your numbers

    column2: applies to...

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

  • Reply To: UPDATE statement on CTE with INNER JOIN

    In the FROM clause of the UPDATE statement you list the table 'Orders'.  My guess is you intend for this to be the CTE but if the schema is not...

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

  • Reply To: Need to replace this inefficient CASE statement

    I agree.  The answers are equivalent at best.

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

  • Reply To: Need to replace this inefficient CASE statement

    drop proc if exists dbo.test_case_cross;
    go
    create proc dbo.test_case_cross
    @node_order int,
    @Record_Key_4 ...

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

  • Reply To: Need to replace this inefficient CASE statement

    Here's how I'm testing it.  I'm switching over to John and Jonathan's in the case where there are not nullable columns.  Still with the CROSS JOIN.  Wait a sec

     

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

  • Reply To: Need to replace this inefficient CASE statement

    Yeah I'm getting counterexamples too including my own.  Which columns can be NULL?

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

  • Reply To: Need to replace this inefficient CASE statement

    ...
    from
    Popup_Switches ps
    cross join
    #temp_1 t
    where
    ps.popup_gid in(2, 5)
    and t.node_order=1
    and (t.record_Key_4 = '1' or t.Record_Key_5 NOT IN ('I', 'X'));

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

  • Reply To: Need to replace this inefficient CASE statement

    It's an unusual query.  There's no join condition so it's really a CROSS JOIN.  I would guess the temp table always returns 1 row.  No matter what this query will...

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

  • Reply To: STUFF Function use

    Ha it's the exact same query.

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

  • Reply To: STUFF Function use

    with grupo_cte(idTipoGrupoCons, intIdEntidad, intIdEjercicio) as (
    select 16, 50, 7
    union all
    select 16, 45, 4
    ...

    • This reply was modified 6 years, 4 months ago by Steve Collins. Reason: type

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

  • Reply To: Optimizing view and Table

    christoph.kauflin wrote:

    The table has grown and grown and needs around 3.7 GB for 2.2 Million records.

    It's the size of the Excel file with the pivot table?

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

  • Reply To: Surrender, Just a Little

    jonathan.crawford wrote:

    I think the trick is that we're all in the same boat, so stating why you oppose something but knowing that the final decision might be somewhere else is...

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

  • Reply To: Surrender, Just a Little

    MVDBA (Mike Vessey) wrote:

    I'm not sure I agree on this one - cooperation leads to learning. rather than fight them we can mentor them

    MVDBA (Mike Vessey) wrote:

    Now I work in marketing... the only thing...

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

  • Reply To: Feeling My Way Into SQL

    In the FROM clause of the "main query" the table dbo.ShtStock had been LEFT JOINED to based on the ShtStockId.  I changed that to be the dbo.NZ(...) function.  The "main...

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

Viewing 15 posts - 1,171 through 1,185 (of 1,413 total)