Forum Replies Created

Viewing 15 posts - 1,126 through 1,140 (of 1,413 total)

  • Reply To: Get the correct output

    If dupes are ok but the alerttypeid may only be in (4, 6), then maybe this works

    with only_two_cte(alertid) as (
    select
    ...

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

  • Reply To: Get the correct output

    with only_two_cte(alertid) as (
    select
    alertid
    from
    #aaa
    ...

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

  • Reply To: Get the correct output

    Ok yeah I'm starting to see the alerttypeid's should be counted separately.

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

  • Reply To: Get the correct output

    with only_two_cte(alertid) as (
    select
    alertid
    from
    #aaa
    ...

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

  • Reply To: Get the correct output

    select distinct
    first_value(alertid) over (partition by alerttypeid order by alertid desc) alertid,
    alerttypeid
    from
    #aaa
    where
    alerttypeid in(4,6);

     

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

  • Reply To: Query Help - Sum question with excluding condition

    Steve Collins wrote:

    ;with
    ordered_amounts as (
    select distinct first_value(amount) over (partition by userid order by keyid desc) amount from #t)
    select
    sum(amount) total
    from
    ordered_amounts;

    This...

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

  • Reply To: Query Help - Sum question with excluding condition

    ;with
    ordered_amounts as (
    select distinct first_value(amount) over (partition by userid order by keyid desc) amount from #t)
    select
    sum(amount) total
    from
    ordered_amounts;

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

  • Reply To: Scalar function too slow - Calculated field in column based on another columns

    Baldie47 wrote:

    I need one column for BSP between 1 and 3, one column for BSP between 3 and 5, one column for bsp between 5 and 8 (and up to...

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

  • Reply To: Scalar function too slow - Calculated field in column based on another columns

    Sometimes spreadsheets are useful to concatenate together parameterized sql code.

    ="sum(case when (td.BSP >="&B7&" and td.BSP <"&C7&") and td.WIN_LOSE=1 then td.BSP end) as SumWinnerPrice"&B7&"to"&C7
    ="count(case when (td.BSP >="&B8&" and...

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

  • Reply To: String extraction - SQL 2012

    declare
    @txt varchar(100)='CKnovelty2002_pouch-5AR-OneSize';
    --@txt ...

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

  • Reply To: The Developer Arguments for Stored Procedures

    dmbaker wrote:

    Xedni wrote:

    I had a similar difficulty in explaining why I felt procs were preferable to EF.

    By "EF" do you mean "Entity Framework" as in Microsoft? You do realize...

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

  • Reply To: The Developer Arguments for Stored Procedures

    "...from a developer point of view..."  Why is it "more difficult" to build with stored procedures:

    1. It makes your entire project dependent on the DBA.  Not as satisfying as being...

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

  • Reply To: The Evolution of AI

    It's all predicated on the false assumption "a billion flies can't be wrong"

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

  • Reply To: db table design

    cole-p wrote:

    ...how the design of a database schema (logical design of tables and queries)  is affected by horizontal scaling...

    Primarily through indexing.  Indexes are logical objects which exist for purely physical...

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

  • Reply To: How to implement row last access date column

    There are a lot of assumptions baked into the questions.  Why are you storing shopping cart information as serialized data?

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

Viewing 15 posts - 1,126 through 1,140 (of 1,413 total)