Need help adding 3rd table to a Join

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nikolap
    New Member
    • Aug 2006
    • 3

    Need help adding 3rd table to a Join

    Hi can someone help me I'm brainless, I need to add a field from a third database to this view

    CREATE View mProduct_Search

    As

    Select

    mProduct.*,

    (IsNull(mProduc t.PRICE,0) * 2) as [DISPLAY_PRICE],

    (IsNull(mProduc t.LINER_PRICE,0 ) * 2) as [DISPLAY_LINER_P RICE],

    (mProduct.ITEM_ ID + ' ' +IsNull(mProduc t.[SHORT_DESCRIPTI ON],' ') + ' ' + IsNull(mProduct .[CAT_PG],' ') + ' '+ IsNull(mProduct .[CATEG],' ') + ' ' + IsNull(mProduct .[DESCRIPTION1],' ') + ' ' + IsNull(mProduct .[DESCRIPTION2],' ') + ' '

    + IsNull(mProduct .[DESCRIPTION3],' ')) as [GENARAL_SERACH],

    A.PERC as [PERC], A.START_DATE AS [START_DATE], A.END_DATE AS [END_DATE], A.DESCR as [DESCR]

    from mProduct Left Outer Join (Select * from mSpecialPricing ) A

    ON mProduct.ITEM_I D = A.ITEM_ID


    The field I need to add is COLLECTION, with Left Outer Join

    mCollection
    ITEM_ID
    COLLECTION
  • goingpostal
    New Member
    • Aug 2006
    • 3

    #2
    And COLLECTION is a member of which table?

    Comment

    • nikolap
      New Member
      • Aug 2006
      • 3

      #3
      I need the COLLECTION field from the mCollection Table to be included in the mProduct_Search view

      Comment

      • nikolap
        New Member
        • Aug 2006
        • 3

        #4
        Nevermind my brain came back to life, I have answered my own question...
        CREATE View mProduct_Search

        As

        Select

        mProduct.*,

        (IsNull(mProduc t.PRICE,0) * 2) as [DISPLAY_PRICE],

        (IsNull(mProduc t.LINER_PRICE,0 ) * 2) as [DISPLAY_LINER_P RICE],

        (mProduct.ITEM_ ID + ' ' +IsNull(mProduc t.[SHORT_DESCRIPTI ON],' ') + ' ' + IsNull(mProduct .[CAT_PG],' ') + ' '+ IsNull(mProduct .[CATEG],' ') + ' ' + IsNull(mProduct .[DESCRIPTION1],' ') + ' ' + IsNull(mProduct .[DESCRIPTION2],' ') + ' '

        + IsNull(mProduct .[DESCRIPTION3],' ')) as [GENARAL_SERACH], B.COLLECTIONS as [COLLECTIONS],

        A.PERC as [PERC], A.START_DATE AS [START_DATE], A.END_DATE AS [END_DATE], A.DESCR as [DESCR]

        from mProduct Left Outer Join (Select * from mSpecialPricing ) A

        ON mProduct.ITEM_I D = A.ITEM_ID

        Left Outer Join (Select * from mCollections) B

        on mProduct.ITEM_I D = B.ITEM_ID

        Comment

        Working...