Forum Replies Created

Viewing 15 posts - 571 through 585 (of 2,007 total)

  • RE: without [union] in Query

    Koen Verbeeck (8/1/2012)


    Allright, I managed to rewrite the query without using UNION or UNION ALL:

    SELECT COALESCE(A.ID,B2.ID), COALESCE(A.Value, B2.Value)

    FROM

    A

    LEFT OUTER JOIN

    B B1

    ON A.ID = B1.ID

    FULL OUTER JOIN

    B B2

    ON B2.ID = B1.ID

    WHERE...

  • RE: trying to add alias for value generated by Where clause

    polkadot (7/31/2012)


    ---QUERY that returns cumulative total by DayCount

    SELECT a.DayCount,

    a.Sales,

    SUM(b.Sales)

    FROM Sales a

    CROSS JOIN Sales b

    WHERE (b.DayCount <=...

  • RE: without [union] in Query

    SELECT

    CASE WHEN a.id IS NULL THEN b.id ELSE a.id END AS id,

    CASE WHEN a.value IS NULL THEN b.value ELSE a.value END AS value

    FROM (SELECT [id], [value]

    ...

  • RE: How to add alohanumeric before ID

    This is looking for a decimal -->

    cmd.Parameters.Add("@idcount", SqlDbType.Decimal);

    You want to return a string.

    cmd.Parameters.Add("@idcount", SqlDbType.VarChar, 22);


    --edit--

    I'd like to suggest again that you talk to one of the more senior developers in...

  • RE: How to add alohanumeric before ID

    Total guess, as I can't see the app code you have in front of you, nor the data, nor do I fully understand your requirements. You may be better off...

  • RE: XML

    /* Sample data */

    CREATE TABLE [dbo].[Abc] ([sid] [int] NULL, [sname] [varchar](20) NULL) ON [PRIMARY];

    INSERT INTO [Abc] ([sid], [sname])

    VALUES (1, 'xx');

    INSERT INTO [Abc] ([sid], [sname])

    VALUES (2, 'yy');

    INSERT INTO [Abc] ([sid], [sname])

    VALUES...

  • RE: Is there an joiner much like the 8kSplitter?

    Lynn Pettis (7/27/2012)


    One piece is missing for my understanding, without the concatenation if I were to query the tables, how do they relate to one another, and based on the...

  • RE: Is there an joiner much like the 8kSplitter?

    OK, I built my own sample data.

    SELECT TOP 4000000 CAST(NEWID() AS VARCHAR(36)) AS concatenateMe

    INTO dbo.myTable

    FROM master.sys.all_columns a, master.sys.all_columns b, master.sys.all_columns c

    4 million rows.

    Here's how we'll concatenate them the first time...

  • RE: Is there an joiner much like the 8kSplitter?

    anthony.green (7/27/2012)


    Thanks all.

    With John's solution the view complete its run in 7 minutes 7 seconds and didnt max out TempDB.

    I have had to change Lynn's solution slightly

    <snip>

    Do me a favour...

  • RE: Picture

    dbasql79 (7/25/2012)


    Hi folks,

    Can you please let me know how to use a picture for my profile.

    I am looking to edit my account to use any picture. I cant...

  • RE: Not able to insert a particular value

    Could be a constraint on the table.

  • RE: Evaluate expression and store the result

    Here's a bit less of a wordy solution.

    First, your sample data: -

    --Create your sample data

    SELECT id1,exp1,result

    INTO #tbl_expression

    FROM (VALUES(1,'30 > 50',Null),(2,'70 > 50',Null),(3,'20 = 20',Null)

    ...

  • RE: containstable not returning expected results

    krishna.netblogs (7/26/2012)


    Hi All,

    I have to serach for a word from a table . I have used containstable() function , but not getting expected...

  • RE: repeatin value in my procedure

    raghuldrag (7/25/2012)


    Hi friends,

    I m write procedure for the problem is

    <SNIP>

    Hello and welcome to SSC!

    I'd like to be able to help you, but it seems you've forgot to post readily...

  • RE: Computed columns: max from other column for the same ID

    From BOL: -

    A computed column is computed from an expression that can use other columns in the same table. The expression can be a noncomputed column name, constant, function, and...

Viewing 15 posts - 571 through 585 (of 2,007 total)