Forum Replies Created

Viewing 15 posts - 3,766 through 3,780 (of 4,820 total)

  • RE: Query Help -- Percentile Calculation for each value

    Try the following:

    DECLARE @Table AS TABLE (Score Varchar(4), Percentile int);

    INSERT INTO @Table (Score)

    VALUES ('80'),('55'),('125'),('99'),('75'),('130'),('37'),('73'),('151');

    WITH RANKS AS (

    SELECT *, NTILE(4) OVER (ORDER BY CAST(Score AS int)) AS QUARTILE

    FROM @Table

    ),

    ASSIGNS AS (

    SELECT...

  • RE: Year summary report - GROUPING SETS OR ROLLUP

    Without any actual data to play with, I can't test this, but you should end up with something like this:

    WITH MONTHS AS (

    SELECT 1 AS MN, 'Jan' AS MTH_NAME UNION...

  • RE: Help grouping/joining two tables

    This should be fairly straightforward. The question, however, is which of the two tables should be considered the "authority" for the values that are NOT part of the...

  • RE: OPENROWSET(BULK @path )

    I'm pretty sure no one here has any idea what you're question is. Please be specific as to what you want, with as many details as possible to...

  • RE: Query Help -- Percentile Calculation for each value

    How about the following:

    DECLARE @Table AS TABLE (Score Varchar(4), Percentile int);

    INSERT INTO @Table (Score)

    VALUES ('80'),('55'),('125'),('99'),('75'),('130'),('37'),('73'),('151');

    WITH RANKS AS (

    SELECT *, NTILE(4) OVER (ORDER BY CAST(Score AS int)) AS QUARTILE

    FROM @Table

    ),

    ASSIGNS AS...

  • RE: Need to identify genuine stock quantity discrepancies between ERP & WMS?

    David,

    How about the following?

    WITH DIFFERENCES AS (

    SELECT Tx.[Item Code]

    , ISNULL(Ty.Qty, 0) AS 'A1 Qty'

    , Tx.Qty AS 'B1 Qty'

    , Ty.Qty - Tx.Qty AS 'A1 to...

  • RE: Help with SQL Cursor

    Uma,

    It was nice to have provided detail in the PDF, but the level of effort necessary to be effective in helping you rises above the amount of time available for...

  • RE: SSRS - Reporting Website

    Why, exactly, would you need this? SSRS provides some of that functionality out of the box. If you go to http://yourservername/reports or http://yourservername/reportmanager (I always forget...

  • RE: "Order" between JOIN and APPLY

    ChrisM@Work (11/21/2014)


    sgmunson (11/21/2014)


    Can I ask what might seem like a dumb question? Why is anyone trying so hard to write this query in such a way as to...

  • RE: "Order" between JOIN and APPLY

    Can I ask what might seem like a dumb question? Why is anyone trying so hard to write this query in such a way as to make it...

  • RE: "Order" between JOIN and APPLY

    I happened to do a Google search yesterday, and it brought me to an MSDN page that describes the APPLY operator, and an OUTER APPLY is roughly equivalent to a...

  • RE: "Order" between JOIN and APPLY

    I'm pretty sure Mr. Magoo has your answer, but the bigger and maybe more important question, is why leave code hanging around that is formatted that way, when there are...

  • RE: "Order" between JOIN and APPLY

    btio_3000 (11/20/2014)


    "data" here is an xml field of Table 1, sorry I did not mentioned it initially

    Thanks!

    Okay, but that hardly begins to answer the questions I posed. ...

  • RE: "Order" between JOIN and APPLY

    That post doesn't really tell me anything you hadn't either stated or implied before, but you also introduced new questions without answering any of the ones I asked. ...

  • RE: "Order" between JOIN and APPLY

    btio_3000 (11/19/2014)


    sgmunson (11/19/2014)


    I don't know the direct answer, but why place the ON clause for that LEFT JOIN in a position AFTER the CROSS APPLY unless you intended that CROSS...

Viewing 15 posts - 3,766 through 3,780 (of 4,820 total)