Insert values from one table to another table

  • Hi,

    I have two tables. Table Name 1 : UserPermission Table Name 2: UserFeaturetype.

    UserPermission UserFeaturetype

    ============ =============

    UserId Usertypeid featureoperationid Usertypeid featureoperationid

    60 3 5 3 1

    60 3 6 3 3

    60 3 7 3 8

    3 5

    3 6

    3 7

    What is my query that in UserPermission table i need to insert UserFeaturetype table values without already inserted featureoperationid that is 5,6,7 is already inserted in Table 1. I need to avoid duplication that is need to insert 1,3,8.

    My output could be like that is

    60 3 5

    60 3 6

    60 3 7

    60 3 1

    60 3 3

    60 3 8

    Give me suggestion. Hope's your reply soon.

    Thanks

  • In case anyone is wondering, this is what the post should have looked like. The "normal" forum lettering ate the leading spaces. I was able to recover them by quoting the OP and pasting between the plain code IFCode markers.

    UserPermission UserFeaturetype

    ============ =============

    UserId Usertypeid featureoperationid Usertypeid featureoperationid

    60 3 5 3 1

    60 3 6 3 3

    60 3 7 3 8

    3 5

    3 6

    3 7

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply