• Two more questions. I am new to using a CTE, so bear with me 🙂

    There are tables with 20 or more columns. Can I use a wild card like *, if not I have no problem listing them out, just checking. (I tried replacing the column names with a *, but it didnt work)

    I wanted to check for duplicates across all columns, which I got sorted thanks to your help.

    Now I have some duplicates where the activitygroup_desc and request_id are the same but the pulldate is different. (due to my bad usage of the update and insert routine i wrote - its now fixed) The table will have the request_id used multiple times as its tied to the activitygroup_desc. Here is an example of the data:

    ACTIVITYGROUP_DESCREQUEST_ID PullDate

    Customer Requests39 2012-10-05

    Customer Requests39 2012-09-27

    Lab Services 39 2012-09-27

    Customer Requests40 2012-10-04

    Lab Services 40 2012-10-02

    Customer Requests40 2012-10-02

    Customer Requests41 2012-09-17

    Customer Requests42 2012-10-08

    Any recomendations to modify the CTE to look at column1, column2, and when there is a duplicate remove the one with the older pull date in column3? Does that make sense?