Forum Replies Created

Viewing 15 posts - 3,646 through 3,660 (of 10,144 total)

  • RE: Please help to sort this

    Do you have a fixed number of colours? If so, can you list them please?

  • RE: SQL Query

    balu.arunkumar (2/10/2014)


    Hi This part shows error.

    /*------------------------

    SELECT*, SUM( Price ) OVER( Partition BY Customer_Name ORDER BY DatePurchased) AS Total_Till_Date

    FROM#sample where Customer_Name='A'

    ------------------------*/

    Msg 102, Level 15, State 1, Line 1

    Incorrect syntax near 'order'.

    Which...

  • RE: Please help to sort this

    This is the easy way out!

    DROP TABLE #COLORS

    CREATE TABLE #COLORS (COLORS VARCHAR(50))

    INSERT INTO #COLORS

    SELECT '1 - Green = FHG' UNION ALL

    SELECT ' 2 - 3< Amber <10' UNION ALL

    SELECT...

  • RE: INSERT INTO, EXCLUDING ONE COLUMN

    Can you provide us with a brief description of the end to end process?

  • RE: Are the posted questions getting worse?

    GilaMonster (2/7/2014)


    jasona.work (2/7/2014)


    ChrisM@Work (2/7/2014)


    Anybody else seeing a kinky image of Koen, Gail and Grant wondering around without their tshirts?

    /Using my best George Takei imitation

    Ooh My...

    😉

    At least he's not imagining us...

  • RE: Count NULL columns

    karthik M (2/7/2014)


    VALUES (t1), (t2), (t3), (t4))

    I have 119 columns in the actual table. Do I need to use all those names in VALUES clause?

    You could use dynamic SQL,...

  • RE: Are the posted questions getting worse?

    Anybody else seeing a kinky image of Koen, Gail and Grant wondering around without their tshirts?

  • RE: I need to write a query using a join

    SELECT t1.* --, t2.*

    FROM #TEMP t1

    LEFT JOIN #TEMP t2 ON t2.LNAME = t1.LNAME AND t2.DriverID <> t1.DriverID

    WHERE t1.Disposition = 'Guilty'

    AND t2.DriverID IS NULL

  • RE: INSERT INTO, EXCLUDING ONE COLUMN

    hoseam (2/7/2014)


    here's the idea behind Dynamic SQL:

    The user will be passing table name to make changes to it...

    Data changes, or table structure changes?

  • RE: Count NULL columns

    SELECT t.eno, d.NullCount

    FROM test t

    CROSS APPLY (

    SELECT NullCount = 4 - COUNT(col) FROM (VALUES (t1), (t2), (t3), (t4)) d (col)

    ) d

    WHERE d.NullCount > 2

  • RE: INSERT INTO, EXCLUDING ONE COLUMN

    hoseam (2/7/2014)


    Without listing the columns??

    No - as Lowell said, you will need a column list on the SELECT side.

    Once you've been bitten a few times, you will realise it's...

  • RE: UNABLE TO RETRIEVE data while using between operator

    batesview (2/7/2014)


    This can really reach out to bite you when dates are involved, again sort of obvious but so easy to forget/overlook

    It certainly can - but Jeff Moden has most...

  • RE: UNABLE TO RETRIEVE data while using between operator

    Thanks. There are tons of these little bitty helpful tricks and you will find a good many are covered in Spackle articles by Jeff Moden.

  • RE: CASE Statement multiple aurgument

    It is possible for a CASE block to change the number of rows returned by SELECT with DISTINCT.

    Find a filter (a WHERE clause) which returns only rows which you...

  • RE: Multiples address lines on a single row. Pivot?

    Danster (2/5/2014)


    ...

    What I want is this:

    RowID, 1stAddr1, 1stAddr2, 1stAddr3, 1stAddr4, 1stPostcode, 2ndAddr1, 2ndAddr2, 2ndAddr3 (etc)

    ...

    What's the maximum number of addresses per RowID?

Viewing 15 posts - 3,646 through 3,660 (of 10,144 total)