Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2012
    Posts
    18

    Unanswered: Join with contain Help

    Hey guys

    I am hoping this is the last question of the day
    Aim There are various lengths of MID_External and MID_Internal in the [FDMS].[SalesForce].[DailyAccounts] table.
    I want to find some kind of match from [FDMS].[SalesForce].[DailyAccounts] into [FDMS].[dbo].[stg_LMPAB502] where ,[Client_Conf] = Y

    The length of FDMSaccountno is 12 and the length of external_Id is 15 in table [FDMS].[dbo].[stg_LMPAB502]. This is the correct length for these appropiate fields

    SELECT [FDMSAccountNo]
    ,[External_ID]
    ,[Client_Conf]
    FROM [FDMS].[dbo].[stg_LMPAB502]
    MID_Internal = FDMSaccountno
    MID_External = [External_ID]

    Would appreciate any help available

    Eg results
    Mid_internal 870650888 = Length 11
    Fdmdaccountno 878306508887 = Length 11
    would be a match
    Last edited by masond; 08-15-13 at 08:49. Reason: Wildcard Help

  2. #2
    Join Date
    Dec 2007
    Location
    Richmond, VA
    Posts
    1,328
    Provided Answers: 5
    length(my_col) = 11???

  3. #3
    Join Date
    Aug 2012
    Posts
    18
    HI thanks for the post
    the length always varies, so i dont want to do indvidual statments, was hopingi could used a generic search

  4. #4
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Your post makes no sense at all.
    This statement won't even parse:
    Quote Originally Posted by masond View Post
    SELECT [FDMSAccountNo]
    ,[External_ID]
    ,[Client_Conf]
    FROM [FDMS].[dbo].[stg_LMPAB502]
    MID_Internal = FDMSaccountno
    MID_External = [External_ID]
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  5. #5
    Join Date
    Dec 2007
    Location
    Richmond, VA
    Posts
    1,328
    Provided Answers: 5
    not sure what you are after then. do you mean the one column is longer than the other and you want to compare based on the length of the smaller? Something like:

    AND MY_SMALL_COL = SUBSTR(MY_LONG_COL,1,LENGTH(MY_SMALL_COL) - 1)

    ???

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •