Forum Replies Created

Viewing 15 posts - 286 through 300 (of 2,171 total)

  • RE: Finding the Correct Weekday Regardless of DateFirst

    SELECT 1 + DATEDIFF(DAY, 0, '20091217') % 7


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

  • RE: Forecasting with SQL

    piet_dj (2/10/2010)


    Do you have any useful info on calculating multiple linear regression with T-SQL?

    Here http://developerworkshop.net/software.html

    It also handles logarithmic, exponential and power regression.


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

  • RE: Optimization for Update statement

    UPDATEbt

    SETbt.CustCode =CASE

    WHEN x.LowerNum IS NULL THEN 'N'

    ELSE 'Y'

    END

    FROMdbo.BatchTrans AS bt

    LEFT JOIN(

    SELECTLEFT(BottomRange + REPLICATE('0', 50), 50) AS LowerNum,

    LEFT(TopRange + REPLICATE('9', 50), 50) AS HigherNum

    FROMdbo.ForeignBins

    ) AS x ON x.LowerNum <= bt.CardNum

    AND x.HigherNum...


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

  • RE: Optimization for Update statement

    How large are the BottomRange and TopRange intervals?


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

  • RE: update command

    Please beware that a correlated subquery is an outer join.

    If you have a value in target table before, and the correlated subquery doesn't return any value, the target table value...


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

  • RE: is sql ? is oracle? is sybase? possible to concatenate?

    I think OP wants several methods to concatenate result, which should work in all three RDMS's.

    What we provided is a way for SQL Server to deal with this.

    It's a monday...


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

  • RE: is sql ? is oracle? is sybase? possible to concatenate?

    OP, the senior application engineer, told us that ISADMIN columns had zeros in all the records. It is not true. It is column ISCONT that has zeros in all columns.


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

  • RE: is sql ? is oracle? is sybase? possible to concatenate?

    Here is a solution.

    DECLARE@Emp TABLE

    (

    eno int,

    ename varchar(5),

    isemp bit,

    iscont bit,

    isadmin bit,

    ishr bit

    )

    insert@emp

    select1, 'aa', 1, 0, 0, 1 union all

    select1, 'aa', 0, 0, 1, 1 union all

    select1, 'aa', 1, 0, 0, 1...


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

  • RE: is sql ? is oracle? is sybase? possible to concatenate?

    No, ISCONT has zeros in all the records.


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

  • RE: Subroutines in TSQL

    You can do this with SQL Server 2008 and the new table value parameters.

    If you are working on a set of data, you can pass that set of data to...


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

  • RE: Hitting nVarchar(max) limitation when running exec sp_executesql

    shannonjk (1/7/2010)


    How would I use this in my code?

    It's quite tricky to answer because we haven't seen your code yet.


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

  • RE: number grouped sets ( SQL 2005)

    SELECT ROW_NUMBER() OVER PARTITON BY SSN ORDER BY Amount) AS row_num,

    SSN, Amount

    FROM Table1


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

  • RE: Include count of zero in query

    See the GROUP BY part above. I added it now.


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

  • RE: Include count of zero in query

    Well, I have some time left...

    SELECTc.ConstructNo,

    b.ImportanceBands,

    COUNT(cib.ConstructNo) AS [Count]

    FROM(

    SELECTConstructNo

    FROMCompetencyImportanceData

    GROUP BYConstructNo

    ) AS c

    CROSS JOIN(

    SELECTImportanceBands

    FROMImportanceLevelBands

    GROUP BYImportanceBands

    ) AS b

    LEFT JOINCompetencyImportanceData AS cib ON cib.ConstructNo = c.ConstructNo

    AND cib.ImportanceScoreBand = b.ImportanceBands

    GROUP BYc.ConstructNo,

    b.ImportanceBands


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

  • RE: Include count of zero in query

    Thank you. I thought I should post the link so that no more double unneccessary work is done.

    I suggested your approach first, but after som clarifications, I saw that OP...


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

Viewing 15 posts - 286 through 300 (of 2,171 total)