Forum Replies Created

Viewing 15 posts - 826 through 840 (of 897 total)

  • RE: Replace

    ; WITH cteTableName AS

    (

    SELECTROW_NUMBER() OVER( PARTITION BY Man_name ORDER BY Model ) RowNum, *

    FROMTableName

    )

    SELECTCASE WHEN RowNum > 1 THEN '' ELSE Man_name END Man_name, Model

    FROMcteTableName

    This should do it for you..

  • RE: Trigger

    Why such a strange requirement? What is the problem if the trigger gets called 10 times? But still if you want the trigger to be called only once try converting...

  • RE: Help with Query-one primary key in a table linked to many column in the second table as a forein key

    SELECTE.*

    FROMTRANSACTION T

    INNER JOIN EMPLOYEE E ON T.RegisteredBYEmpID = E.EmpID

    WHERET.RegisteredBYEmpID = T.ApprovedByEmpID

    I hope this will give you the desired result. It would have been better if you had provided some sample...

  • RE: Where are you?

    Bhuvnesh (3/23/2010)


    Kingston Dhasian (3/22/2010)


    But i have spoken to thousands of U.S citizens without going out of India even once. Guess how???

    Clients interaction 🙂 ?

    Which company would be having thousands of...

  • RE: Where are you?

    Born in Kanniyakumari ( India )

    Brought up in Mumbai ( India )

    Employed for a year in Chennai ( India )

    Now i am back in Mumbai working on SQL Server 2005.

    But...

  • RE: Getting date + Filter it !!! how ???

    steveb. (3/22/2010)


    Kingston Dhasian (3/22/2010)


    SELECT*

    FROMdt

    WHEREDAY( DATEADD( DAY, 1, dt ) ) != 1

    I don't think performance should be a concern as almost all the rows ( hopefully ) are returned....

  • RE: Getting date + Filter it !!! how ???

    Jeff Moden (3/22/2010)


    Will any of those dates ever have a time associated with them? That's a bit of a rhetorical question... you should always assume they will and write...

  • RE: Getting date + Filter it !!! how ???

    SELECT*

    FROMdt

    WHEREDAY( DATEADD( DAY, 1, dt ) ) != 1

    I don't think performance should be a concern as almost all the rows ( hopefully ) are returned. In such a case...

  • RE: How to find the 3rd Max in a column?

    chandrasekaran.ganapathy (3/22/2010)


    Hi Kingston,

    Just for curiosity asking, can we handle the tie value in Row_number()?

    No, you can't. You can use the RANK or the DENSE_RANK for the same.

    Again both of...

  • RE: How to find the 3rd Max in a column?

    chandrasekaran.ganapathy (3/22/2010)


    No specific reason? I want to handle the tie value also. that's why? can we handle tie value also in row_number?

    ROW_NUMBER gives unique values even if it is a...

  • RE: How to find the 3rd Max in a column?

    chandrasekaran.ganapathy (3/22/2010)


    I guess DENSE_Rank is the better way. I don't like to use Row_Number. Thanks for the answer.

    Select Salary from Table1 Where Salrank='3' Where (Select Dense_Rank()

    over (Order By Salary...

  • RE: How to use If not exists

    What is the result set that you are getting.

  • RE: How to use If not exists

    Does the below query return any NULL values

    select (EngineerId) from Table2

  • RE: How to use If not exists

    chandrasekaran.ganapathy (3/19/2010)


    This is ok if the table1 does not have the repetition of EngineerId. But Table1 has the repetition of EngineerId. I've tried your code. It says Primary Key violation....

  • RE: Answers to Your QOD

    I doubt if anybody is going to get this right. 20 attempts so far and nobody has got it till now.

    It would be better somebody from SSC reviews the Question...

Viewing 15 posts - 826 through 840 (of 897 total)