Forum Replies Created

Viewing 15 posts - 1,471 through 1,485 (of 2,171 total)

  • RE: SELECT FROM @variable

    Let him enter the field of landmines by using dynamic SQL.

    See http://www.sommarskog.se/dynamic_sql.html

     


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: Select Query Question

    Yes. It is called PIVOT or CROSSTAB queries.

    There are examples of this in Books Online.

    Or have a look at

    http://www.sqlservercentral.com/columnists/plarsson/pivottableformicrosoftsqlserver.asp

     


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: How to extract month and year(combined) from a date

    The modesty doesn't suite you

    There are many people listen (read) to what you say (write)

     


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: Cross Joins

    DECLARE

    @a TABLE (Col1 INT)

    INSERT

    @a

    SELECT

    1 UNION ALL

    SELECT


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: Query question

    I thought Monday to Wednesday were (2, 3, 4)

     


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: delete duplicates

    ===== Jeff ======

    DBCC execution completed. If DBCC printed error messages, contact your system administrator.

    DBCC execution completed. If DBCC printed error messages, contact your...


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: delete duplicates

    USE TEMPDB

    CREATE TABLE DBO.AILMENTDETAIL (

      AILMENTDETAILID INT  IDENTITY( 1  , 1  ),

      AILMENTID       INT,

      DATAPOINTID     


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: delete duplicates

    I think Jeff soon will post his million record test again

    Checking the query plans I might think Jeff's suggestion is faster.

     

     


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: delete duplicates

    DELETE

         ad

    FROM       AilmentDetail AS ad

    LEFT JOIN  (

                   SELECT   MIN(


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: How to export only certain records

    Well, with SQL Server 2005, you can do this with ROWNUMBER() function.

     


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: sort order

    From App you wrote?

    If you use the ADO library, just put the sorting string to the Sort method.

     


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: Query Help to find multiple Values

    SELECT d.PRODUCTID, d.Value FROM Table1 AS d

    INNER JOIN (SELECT Value  FROM Table1 GROUP BY Value HAVING COUNT(*) > 1) AS t ON t.Value = d.Value

     


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: Last Friday of given week

    Is week 1 of any year always starting with the monday on January 1 or nearest monday after?

    Or do you want simple ISO week calulation? Then remember that there can...


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: Replacing ASCII Characters with other ASCII Characters in a table

    select * from resources where resourcename LIKE '%[' + char(224) + char(225) + char(226) + char(227) + char(228) + char(229) + ']%'

    update resources

    set resourcename = replace(replace(replace(replace(replace(replace(resourcename, char(224), char(97)),...


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: Calcuating median values

    You are using SQL Server 2005, are you?

    asc desc diff

    1   4    3  -- even number of datapoints

    2   3    1

    3   2   -1

    4   1   -3

    1   3    2  --...


    N 56°04'39.16"
    E 12°55'05.25"

Viewing 15 posts - 1,471 through 1,485 (of 2,171 total)