Forum Replies Created

Viewing 15 posts - 8,626 through 8,640 (of 8,754 total)

  • RE: Find sequential numbers

    What's next, business holidays and weekends? 😀

    Just for the sake of completion:

    SELECT Eventdate,Status

    INTO #AP_DATA

    FROM (VALUES

    ('2014-01-20 18:00', 0)

    ,('2014-01-20 18:30', 0)

    ,('2014-01-20 19:00', 1)

    ,('2014-01-20 19:30', 0)

    ,('2014-01-20 20:00', 1)

    ,('2014-01-20 20:30', 0)

    ,('2014-01-20 21:00', 0)

    ,('2014-01-20 21:30',...

  • RE: SQL Server 2008 Select All Points within Polygon

    ado-712642 (4/5/2014)


    SSC thank you for your reply. I just tried using this in my table and am a bit confused. If my table structure is like this, what...

  • RE: Find sequential numbers

    J Livingston SQL (4/5/2014)


    are these just for 2012?

    I "thought" that UNBOUNDED PRECEDING/FOLLOWING was introduced in 2012...so not available in 2008?

    may well be wrong.

    nevertheless it provide a solution...

    I wonder what is...

  • RE: SQL Server 2008 Select All Points within Polygon

    Here is the code 😎

    DECLARE @POLIGON GEOMETRY;

    /* ms sample from BOL */

    SET @POLIGON = geometry::STPolyFromText('POLYGON ((5 5, 10 5, 10 10, 5 5))', 0);

    ;WITH NN1(N) AS (SELECT NM.N FROM...

  • RE: Find sequential numbers

    J Livingston SQL (4/5/2014)


    some significant changes between these two editions.....which one is in use now?

    Lets do both with the same solution

    😎

    /* SAMPLE DATA */

    SELECT

    X.NUM

    INTO #MY_NUMBERS

    FROM

    (

    ...

  • RE: COMPARE TWO TABLES COPY TABLEA VALUES TO TABLEB

    Join the two tables and use ISNULL/COALESCE to replace NULLs

    😎

    DECLARE @TABLE_A TABLE

    (

    SNO INT ...

  • RE: Blank Space in an Integer Data Type Column View

    AndrewSQLDBA (4/4/2014)


    Hello Everyone

    Happy Friday

    I am dealing with what I believe is Oracle that is the source of a SQL View.

    I am seeing a data type of Integer in the View,...

  • RE: Geometry - Parallel lines

    This can be done by shifting each point on the line by x and y (@OFFSET_X/Y in the code)

    😎

    DECLARE @line geometry = 'LINESTRING(1 1, 2 2, 3 3, 4 4,...

  • RE: Selection with conditional insert Union

    Use a CTE or a table with the additional email addresses to be added, cross join to a filtered set with code replacement and union the result to the original...

  • RE: Reaping the benefits of the Window functions in T-SQL

    WayneS (4/3/2014)


    Eirikur,

    This is an excellent modification to an already excellent function. Very well done!!! (And it was such a simple change at that.)

    Jeff Moden (3/24/2014)


    Eirikur asked me to review it...

  • RE: XSLT sum and xpath

    Ran your example through on

    http://xslttest.appspot.com/

    noticed the grouping is incorrect, if it is on lccs/lcc/, you will get multiple lines of subtotal.

    NaN could be null or empty string.

    😎

  • RE: Best SQL Version for Users ?

    What about SSDT (Sql Server Data Tools) ?

    😎

  • RE: T-SQL options

    Luis Cazares (4/3/2014)


    Eirikur Eiriksson (4/3/2014)


    Straight forward using Window functions

    Isn't that over complicating something that could be achieved like this?

    SELECT PONum

    ,POLineNum

    ,POSublineNum

    ...

  • RE: T-SQL options

    Straight forward using Window functions

    DECLARE @POSTUFF TABLE

    (

    PONum INT ...

  • RE: GROUP BY

    Think of the columns in the group by as buckets, any aggregation is then applied to each bucket;

    ColAColB

    A1

    B2

    A2

    B3

    Group by ColA -> Aggregation on B

    A (1,2)

    B (2,3)

    or in other words, it...

Viewing 15 posts - 8,626 through 8,640 (of 8,754 total)