Forum Replies Created

Viewing 15 posts - 1,441 through 1,455 (of 2,171 total)

  • RE: Calculating Median - Help

    -- Prepare sample data

    DECLARE @Sample TABLE (Dept INT, Time INT)

     

    INSERT     @Sample

    SELECT     8, 907 UNION ALL

    SELECT     8,...


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: 10 Top 1 rows chosen at random

    Thanks!

     


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: How to FORCE the INDEX in update statment?

    update FSA_EXPORT_TEMP WITH (ROWLOCK, INDEX(<index name here&gt)

    set trading_partner = 'XXX'

    where reporting_date = @reporting_date

    and fsa_le = @fsa_le

    and transfer_le like '%%X'

    and sp_id =@sp_id

     


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: Order by no longer working in SQL 2K5..

    ORDER BY

    --TopLevel Sort

    CASE

    WHEN @SortBy = 'SaleDate' THEN convert(varchar(10),TradeDate,102)

    WHEN @SortBy = 'AccountName' THEN AccountName

    WHEN @SortBy = 'Symbol' THEN Ticker

    WHEN @SortBy = 'SecDesc' THEN Description

    WHEN @SortBy IS NULL THEN Description

    ELSE NULL

    END...


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: Calculating Median - Help

    Median per dept?

    Didn't you see the technique I used with row_number() function...?

     


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: 10 Top 1 rows chosen at random

    -- Prepare sample data

    CREATE TABLE #Movies

    (

    MovieID INT IDENTITY PRIMARY...


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: Why does this stall?

    With the test data posted above, what is the expected result?

     


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: Calculating Median - Help

    See http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=22242

    Last post be me is about SQL Server 2005.

     


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: Unique columns

    Start with the code above and go from there and use DYNAMIC SQL to automate this process.

     


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: 10 Top 1 rows chosen at random

    How are you else going to check that some of the films you are going to show, not already has been shown?

     


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: Unique columns

    SELECT CASE WHEN COUNT(DISTINCT Col1) = COUNT(Col1) THEN 'All unique' ELSE 'Some duplicates' END

    FROM Table1

     


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: finding non alphanumeric characters

    Hmmm..

    ISNUMERIC('$1') = 1

    ISNUMERIC('1E5') = 1

    ISNUMERIC('1D0') = 1

    ISNUMERIC('$1.8') = 1

     


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: Why does this stall?

    Ingen fara och lycka till.

    Är det något mera så "post sample data and expected output" så det blir lättare för oss att förstå vad du är ute efter.

     


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: 10 Top 1 rows chosen at random

    Are you talking about PAGING?

    You want 10 records at a time (one fo each type) on a "page"?

    When you click "next" you want next 10 records (all again of different...


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: Why does this stall?

    -- Prepare sample data

    DECLARE          @Events TABLE (StationID INT, EventDateTime DATETIME, EventTypeID INT, Version INT)

     

    INSERT           @Events


    N 56°04'39.16"
    E 12°55'05.25"

Viewing 15 posts - 1,441 through 1,455 (of 2,171 total)