Forum Replies Created

Viewing 15 posts - 4,786 through 4,800 (of 10,144 total)

  • RE: Rewrite query using LEFT JOIN

    Or this:

    SELECT

    active_flag = CASE WHEN c.active_flag = 1 THEN 'Active' ELSE 'Inactive' END,

    c.name,

    c.company_code,

    d.active_users,

    d.new_users,

    d.inactive_users,

    test_company_flag,

    parent_company_flag

    FROM dbo.company c

    LEFT JOIN (

    SELECT

    company_code,

    active_users= SUM(CASE WHEN active_flag = 1 AND unregister_flag = 0 THEN 1...

  • RE: The Cascading (CROSS) APPLY

    Divya Agrawal (4/18/2013)


    If there is a csv column having different number of comma's in it, how would CCA help in it. In the examples provided by you we can split...

  • RE: Count number of visits by week, ending on Saturday

    -- Group the data by month and by weeks, where a week runs from sunday to saturday

    -- account for a week spanning two months

    SELECT

    v.SchedProv, x.Weekno, x.[Month],

    EarliestApptForWeek =...

  • RE: The Cascading (CROSS) APPLY

    Dwain, Jeff - you guys crack me up! As if I didn't have enough pressure from the escaped dust bunnies 😀

  • RE: The Cascading (CROSS) APPLY

    Divya Agrawal (4/18/2013)


    Great post!! thanks for sharing..it is really very useful

    Thank you very much, Divya!

  • RE: Weekly report through whole year

    roman 19626 (4/17/2013)


    What about if I want same scenario between 1.4.2013 and 14.42013? So each day within this date range is displayed as column?

    Can you show what you mean by...

  • RE: Multiple DMLS in one when clause of MERGE Statement

    28.kanikasoni (4/17/2013)


    I want to use 2 statements in case of when matched clause

    i.e

    Update all the values of Vacancy.TB_FTSearchData

    also

    update the VacancyFTSupdated from table vacancy.TB_Vacancy

    The simple answer is -...

  • RE: The Cascading (CROSS) APPLY

    Tim Walker. (4/16/2013)


    Interesting, entertaining and educational with worked examples and performance statistics make this a great read.

    The fact that it is also genuinely very useful and will help me to...

  • RE: The Cascading (CROSS) APPLY

    Jeff Moden (4/16/2013)


    Awesome job, Chris. Well done!

    Thanks Jeff! And thank you for the encouragement to put pen to paper. DC's been nagging me for ages. Once you stepped in...

  • RE: Need advice on this string manipulate scalar UDF

    Here's an iTVF which might do what you want. You will need to check that the xml concatenation can deal with the characters you wish to include:

    ALTER FUNCTION [dbo].[ifn_RemoveUnwantedChars]

    (@strTarget...

  • RE: comparing list to master list

    Pothiraj R (4/16/2013)


    Hi Chris,

    Thanks for the query. I didn't use the syntax like this.

    FROM (VALUES ('ooo'),('bbb'),('ccc'),('ddd'),('eee'),('fff'),('ggg'),('hhh'),('iii'),('jjj'),('kkk'),('lll')) d (name)

    In the same scenario, I will use UNION ALL with SELECT or insert...

  • RE: comparing list to master list

    KoldCoffee (4/16/2013)


    Thank you.

    Any time.

  • RE: SQL Query - Actual performance duration for every execution

    mrinal.technology (4/16/2013)


    Hi,

    I have a SQL query with couple of nested queries (query at the bottom for the reference), now the very first time I execute the query on a SQL...

  • RE: JOIN on MANY to one and ensuring the JOIN is correct

    pnr8uk (4/16/2013)


    Well it works beautifully so does that mean the productid on the Catalogue table is messed up?

    The script looks like a thing of beauty and works nicely....

    Intrigued...

  • RE: JOIN on MANY to one and ensuring the JOIN is correct

    pnr8uk (4/16/2013)


    Will do Chris - sorry didn't realise there was such a great article as yours, I wondered how so many people got such neat data in the forum.

    Will be...

Viewing 15 posts - 4,786 through 4,800 (of 10,144 total)