Forum Replies Created

Viewing 8 posts - 1 through 8 (of 8 total)

  • RE: Using LAST_VALUE

    preacha (4/16/2015)


    Hi I basically want to return all of the ticketid's that have a reportdate that was changed

    ie...

    TICKETID, REPORTDATE

    a,17/04/15

    a,17/04/15

    a,19/02/14

    b,12/02/15

    b,12/02/15

    b,12/02/15

    c,01/01/15

    c,01/02/15

    should return

    a,17/04/15

    a,19/02/14

    c,01/01/15

    c,01/02/15

    Kinda like the PREVIOUS() function in srss... example was to highlight...

  • RE: Using LAST_VALUE

    Preacha, probably you could spend some time giving more information about the source data and the desired result.

    Telling "here is a query that doesn't work as I want it to",...

  • RE: Using LAST_VALUE

    Very interesting Post.

    Basically, the "expected" behaviour for LAST_VALUE is achievable without ROWS clause, just specifying DESC in the ORDER BY clause of the FIRST_VALUE aggregate.

    SELECT

    ...

  • RE: Using EXCEPT to Determine Row Differences

    brymen (3/25/2014)


    In other words, the article shows how to use [font="Courier New"]EXCEPT[/font] to do something really cool. Compare records with matching primary keys to see if they are identical....

  • RE: Fun with Outer Joins

    rhydian (1/20/2014)


    Surely the following is an easier way to accomplish this...

    SELECT PR.id, PR.ProfessorName, ClassName, ClassYear, ClassSemester

    FROM Professor PR

    LEFT JOIN

    (

    SELECT ProfessorID, ClassName, ClassYear, ClassSemester

    FROM Class

    WHERE...

  • RE: Fun with Outer Joins

    Kenneth.Fisher (1/19/2014)


    Honestly, while I agree that knowing the execution order is important, the idea that all queries can exclude entries in the WHERE clause makes me nervious as *&@#. ...

  • RE: Fun with Outer Joins

    Look at my previous post for an explanation: it's a matter of order of execution.

    Basically, what happens (from a logical point), is this:

    1. A cartesian product of the two tables...

  • RE: Fun with Outer Joins

    It seems to me that a lot of people is not getting really HOW a query is executed.

    But that should be querying 101.

    I would just point out the T-SQL Querying...

Viewing 8 posts - 1 through 8 (of 8 total)