Forum Replies Created

Viewing 15 posts - 1 through 15 (of 49 total)

  • Reply To: The Mangled Outer Join

    Alias name confused and mind thought it should be right join 🙂

  • RE: Help Needed in Relational Logic

    Select M.*,L.Name,L.Company,L.Salary,L.ValidUser, Case when M.ID = R.ParentId then 'Parent' else 'Child' end as Relation

    from @Logic L Join @Releation R On L.Id =R.ParentId

    Join @master M On M.ID in (R.ChildId,R.ParentID)

  • RE: view more efficient than before or not?

    Batch process means SSIS package ?

    If you are using SSIS, recently I came across a situation that extracting data using a view from SSIS slower but running the same view...

  • RE: COUNT() Function

    Great explanation Hugo. Thanks.

    Even I always use COUNT(1) though few times I heard both COUNT(*) and COUNT(1) are same. But today I more clear and thanks for you.

    🙂

  • RE: COUNT() Function

    Hugo Kornelis (4/16/2013)


    Good question, mediocre explanation - no errors, but complicating things more than needed.

    There are three variations of COUNT:

    * COUNT(*) - returns the number of rows, regardless of content.

    *...

  • RE: Calculate number of days missed per term

    Nice one Chris..

    I Understood (Hope) the requirement after seeing the query from Chris... Still not able to bring all the rows.. Not able to get the ID's doesn't have any...

  • RE: Calculate number of days missed per term

    Yes as Vinu said we need a relationship between Term and Attend.

    I have tried the below query and it is not exactly matching your requirement but it might help you...

    Select...

  • RE: How to select data in a particular format

    Hi,

    You can achieve this with Pivot as well..

    SELECT Certyear, [HI-Master] , [HI-Instr] , [HI-Train]

    FROM

    (SELECT Certyear,CertCode,Quantity FROM Certification) C

    PIVOT ( SUM (Quantity) FOR CertCode IN ( [HI-Master], [HI-Instr],...

  • RE: Stored Procedure using huge IO?

    Hi Ananda,

    First delete statment can be done using a CTE like below...the below code might not exactly work for your requirement, please test it with select to match the count.

    ;with...

  • RE: Temp Table Data Types

    Nice Question.

    SELECT * FROM tempdb.INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME LIKE '#TempQoD%'

  • RE: EXECUTE

    It will make effect Kapil. Try the below...

    As in the explanation the scope is only within the EXECUTE statement.

    USE master;

    -- Query#1

    SELECT DB_NAME() DatabaseName1;

    EXECUTE ('USE AdventureWorks2008; SELECT DB_NAME() DatabaseName2');

    -- Query#2

    SELECT DB_NAME()...

  • RE: CHOOSE - 1

    demonfox (1/27/2013)


    Lokesh Vij (1/27/2013)


    Thanks Ron for another one on SS 2012.

    Though I understood the CHOOSE function well, but have to query Employee table to get the answer correctly.

    Ya , without...

  • RE: EOMONTH - 1

    Lokesh Vij (1/20/2013)


    Thanks Ron for another one on SS 2012!

    +1

  • RE: Number of Rows

    Stewart "Arturius" Campbell (1/18/2013)


    paul s-306273 (1/18/2013)


    In my naivete I'm thinking 'so what?'.

    Is there a relevance to this?

    +1

    +1

    I wanted to see the answer and explanation without spending time in analyzing and...

  • RE: Coalesce and Conversion

    Nice Question. Learnt something for today.

Viewing 15 posts - 1 through 15 (of 49 total)