回答済み sp exec

  • Wednesday, May 09, 2012 12:26 PM
     
     

    if i am excuting the sp the same row displays multiple times.. there is no duplicate records ..

    how can i do this?

All Replies

  • Wednesday, May 09, 2012 12:28 PM
    Answerer
     
     
    Please post sample data + desired result

    Best Regards, Uri Dimant SQL Server MVP http://dimantdatabasesolutions.blogspot.com/ http://sqlblog.com/blogs/uri_dimant/

  • Thursday, May 10, 2012 2:42 AM
    Moderator
     
     Answered

    Hi Sagar,

    DISTINCT: Specifies that COUNT returns the number of unique nonnull values. You could use DISTINCT in your T-SQL sentences.

    DISTINCT is an optional keyword that precedes the list of columns specified in the SELECT clause. The DISTINCT keyword asks your database system to evaluate the values of all the columns as a single unit on a row-by-row basis and eliminate any redundant rows it finds.

    Refer to DISTINCT:
    http://msdn.microsoft.com/en-us/library/ms175997.aspx
    http://searchsqlserver.techtarget.com/feature/Using-DISTINCT-in-SQL-to-eliminate-duplicate-rows.

    Thanks,
    Maggie


    Please remember to mark the replies as answers if they help and unmark them if they provide no help. This can be beneficial to other community members reading the thread.