Forum Replies Created

Viewing 15 posts - 166 through 180 (of 1,228 total)

  • RE: Selecting and merging records for a singular complete record

    k.allen.emt (1/25/2015)


    Phil,

    =) sorry, thanks I will give it a shot.

    Beyond new here in this, my buddy tossed me his MySQL book "The Language of SQL" and said read.

    Thank you again......


    [font="Arial"]Low-hanging fruit picker and defender of the moggies[/font]

    For better assistance in answering your questions, please read this[/url].


    Understanding and using APPLY, (I)[/url] and (II)[/url] Paul White[/url]

    Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]

  • RE: Dont get the distinct date

    There are other ways, this is possibly the simplest. You will need to plug in missing table aliases to disambiguate columns:

    SELECT --Distinct

    CAST(fo.OrderDate AS DATE),

    SUM(s1.PUDriverCommission) AS [Commission1],

    SUM(s2.DELDriverCommission) AS [Commission2],

    SUM(s3.Driver3Commission) AS...


    [font="Arial"]Low-hanging fruit picker and defender of the moggies[/font]

    For better assistance in answering your questions, please read this[/url].


    Understanding and using APPLY, (I)[/url] and (II)[/url] Paul White[/url]

    Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]

  • RE: Dont get the distinct date

    shasivashok (1/26/2015)


    Hi,

    I don't get the distinct date in the below query. Anything wrong in this query. Also may i short this query? If yes, Please advise me.

    SELECT Distinct (CAST(FinalizedOrders.OrderDate...


    [font="Arial"]Low-hanging fruit picker and defender of the moggies[/font]

    For better assistance in answering your questions, please read this[/url].


    Understanding and using APPLY, (I)[/url] and (II)[/url] Paul White[/url]

    Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]

  • RE: Recursive data but increasing date by one day

    If the user enters a date range, how many rows should the report display per patient stay - one, same as the source table, or more than one, depending on...


    [font="Arial"]Low-hanging fruit picker and defender of the moggies[/font]

    For better assistance in answering your questions, please read this[/url].


    Understanding and using APPLY, (I)[/url] and (II)[/url] Paul White[/url]

    Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]

  • RE: Is there a better way to write this query.

    Count the rows added to the table. How many seed rows (rows you start with)?


    [font="Arial"]Low-hanging fruit picker and defender of the moggies[/font]

    For better assistance in answering your questions, please read this[/url].


    Understanding and using APPLY, (I)[/url] and (II)[/url] Paul White[/url]

    Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]

  • RE: Triming Data

    Use REPLACE()


    [font="Arial"]Low-hanging fruit picker and defender of the moggies[/font]

    For better assistance in answering your questions, please read this[/url].


    Understanding and using APPLY, (I)[/url] and (II)[/url] Paul White[/url]

    Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]

  • RE: Get Rows from C if Linked Rows in B contain all rows in A

    Charlottecb (10/28/2014)


    Yes you are correct about table b, I've adjusted that now 🙂

    Regards Exist, how would I use it to solve this issue?

    Many thanks

    Charlotte

    Relational division. Joe Celko and Dwain Camps...


    [font="Arial"]Low-hanging fruit picker and defender of the moggies[/font]

    For better assistance in answering your questions, please read this[/url].


    Understanding and using APPLY, (I)[/url] and (II)[/url] Paul White[/url]

    Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]

  • RE: Query Help

    How do you define a member as opposed to a player? What's familyID in both tables?


    [font="Arial"]Low-hanging fruit picker and defender of the moggies[/font]

    For better assistance in answering your questions, please read this[/url].


    Understanding and using APPLY, (I)[/url] and (II)[/url] Paul White[/url]

    Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]

  • RE: increment string by appending 01

    Don't do this. Use a new column for the iteration of name, it will be much easier. How many loads do you perform into the target table?


    [font="Arial"]Low-hanging fruit picker and defender of the moggies[/font]

    For better assistance in answering your questions, please read this[/url].


    Understanding and using APPLY, (I)[/url] and (II)[/url] Paul White[/url]

    Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]

  • RE: Rank duplicates, but only rows involved in duplicates

    sqldriver (10/24/2014)


    ChrisM@Work (10/24/2014)


    -- Changes MERGE JOIN to NESTED LOOPS, loses sort required for ROW_NUMBER()

    Would you mind explaining some more about this part?

    Thanks

    Sure. Have a good look at the actual execution...


    [font="Arial"]Low-hanging fruit picker and defender of the moggies[/font]

    For better assistance in answering your questions, please read this[/url].


    Understanding and using APPLY, (I)[/url] and (II)[/url] Paul White[/url]

    Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]

  • RE: Significant performance dropping when use CASE statement

    BOR15K (10/14/2014)


    Thank you!

    I have looked into the actual execution plan (I am not sure I can publish it here due to company's security policy).

    What I have seen that with CASE...


    [font="Arial"]Low-hanging fruit picker and defender of the moggies[/font]

    For better assistance in answering your questions, please read this[/url].


    Understanding and using APPLY, (I)[/url] and (II)[/url] Paul White[/url]

    Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]

  • RE: Query to split date range into multiple rows based on date insertion - help

    Example, input will start from a member table

    Member , Start date, End date, Status

    M1 1/1/2014 12/31/2014 ...


    [font="Arial"]Low-hanging fruit picker and defender of the moggies[/font]

    For better assistance in answering your questions, please read this[/url].


    Understanding and using APPLY, (I)[/url] and (II)[/url] Paul White[/url]

    Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]

  • RE: query running 15hrs for 1lakh records

    Have you tried posting to a DB2 forum?


    [font="Arial"]Low-hanging fruit picker and defender of the moggies[/font]

    For better assistance in answering your questions, please read this[/url].


    Understanding and using APPLY, (I)[/url] and (II)[/url] Paul White[/url]

    Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]

  • RE: How to perform mathematical formula without using case.

    shahi.alokchandra (9/17/2014)


    I am having 4 Columns Qty decimal(12,3),CF1 Decimal(12,3),CF2 Decimal(12,3),Flag TinyInt.

    I want to perform following without using case please tell me how it is possible.

    When value of Flag is 0...


    [font="Arial"]Low-hanging fruit picker and defender of the moggies[/font]

    For better assistance in answering your questions, please read this[/url].


    Understanding and using APPLY, (I)[/url] and (II)[/url] Paul White[/url]

    Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]

  • RE: UNION ALL Statement hangs engine

    artisticcheese (9/9/2014)


    I can not rewrite the query since this query is code generated from third party packaged application. I can created indexes/update statistics etc but not much abount actual code...


    [font="Arial"]Low-hanging fruit picker and defender of the moggies[/font]

    For better assistance in answering your questions, please read this[/url].


    Understanding and using APPLY, (I)[/url] and (II)[/url] Paul White[/url]

    Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]

Viewing 15 posts - 166 through 180 (of 1,228 total)