Forum Replies Created

Viewing 15 posts - 211 through 225 (of 1,228 total)

  • RE: Filtering on CTE result

    cgreathouse (3/15/2014)


    Thanks Igor, however I was looking for a solution. I was able to put the results into a table first and then use that table, just like...

  • RE: Reseed Max value

    If you change your identity column to BIGINT, you won't have to deal with duplicate ID's. The point of an identity column is to uniquely identify each row, with the...

  • RE: Query of 100 mil rows with multiple parameters

    GilaMonster (3/4/2014)


    ChrisM@home (3/4/2014)


    1. How often do you change a clustered index on a production db?

    I do fairly often, but then that's what I do mostly (database tuning on various badly...

  • RE: Query of 100 mil rows with multiple parameters

    Jeff Moden (3/4/2014)


    ChrisM@home (3/4/2014)


    Jeff Moden (3/2/2014)


    I guess my first recommendation would be to make the PK a nonclustered index. It's currently way too wide to be of any practical...

  • RE: Query of 100 mil rows with multiple parameters

    Jeff Moden (3/2/2014)


    I guess my first recommendation would be to make the PK a nonclustered index. It's currently way too wide to be of any practical use as a...

  • RE: Query of 100 mil rows with multiple parameters

    GilaMonster (3/4/2014)


    ChrisM@Work (2/28/2014)


    Secondly, your ordinary index has most of the columns of the clustered index as INCLUDE columns. This is unnecessary because nonclustered indexes contain the cluster keys - they're...

  • RE: How to update a Table using Loop?

    eligiable (3/2/2014)


    Hi Jeff Moden

    1st alteration will allow to store the Counter values in CounterDesc as an INT or BigINT depends on the records (I got 1 Million and increasing), so...

  • RE: How to update a Table using Loop?

    -- always check an update as the equivalent SELECT before running it.

    -- you may wish to replace the ORDER BY to, say, TerminalNo

    SELECT

    MerchantNo,

    TerminalNo,

    CounterNo = ROW_NUMBER() OVER(PARTITION BY MerchantNo ORDER...

  • RE: retrieve last date for item from two tables?

    Very easily:

    SELECT

    wea = ISNULL(s.wea,c.wea),

    date_time_rt_group_status = MAX(s.date_time),

    date_time_rt_group_coverage = MAX(c.date_time)

    FROM rt_group_status s

    FULL OUTER JOIN rt_group_coverage c

    ON c.wea = s.wea

    GROUP BY ISNULL(s.wea,c.wea)

  • RE: Geeky Entertainment

    Larry Niven "The Magic Goes Away" has plenty of scope for humour.

    Stephen R. Donaldson "The Chronicles of Thomas Covenant" bewitched a whole generation of kids including me and deals with...

  • RE: Geeky Entertainment

    jasona.work (2/28/2014)


    below86 (2/28/2014)


    Wonder Woman!! Linda Carter is still hot.

    :w00t::cool:

    Another book I wouldn't mind seeing made into a movie would be Fallen Angels by Niven / Pournelle / Barnes (I...

  • RE: Geeky Entertainment

    Byron.H (2/28/2014)


    Any of the books from the "Culture" series by Iain [M] Banks, although I recall reading somewhere that the late author preferred not to have his books translated to...

  • RE: Geeky Entertainment

    markradley (2/28/2014)


    I'd love to see a movie version of Rendezvous With Rama by Arthur C. Clarke

    I recently discovered that has been a project of Morgan Freeman's for the last decade,...

  • RE: How to Get data from Table2 instead of Table 1?

    Impossible to "give a query" as Lynn states. You will need to post table definitions with sample data scripts to get a query.

    Try full outer joining the two tables on...

  • RE: retrieve last date for item from two tables?

    SELECT

    wea = ISNULL(s.wea,c.wea),

    date_time = MAX(ISNULL(s.date_time, c.date_time)),

    TableSource = MAX(CASE WHEN s.wea IS NULL THEN 'rt_group_coverage' ELSE 'rt_group_status' END)

    FROM rt_group_status s

    FULL OUTER JOIN rt_group_coverage c

    ON c.wea = s.wea

    GROUP BY...

Viewing 15 posts - 211 through 225 (of 1,228 total)