colaesce the space

Posted on 2011-10-18
Last Modified: 2013-11-16
i have two tables
table a
K1B 3G9
M1B 4H8
table b

i want to join table a and b who can i remove space for table a and join them.
Question by:sam2929
    LVL 11

    Accepted Solution


    Use the COMPRESS function:

    new_postal_code = COMPRESS(Old_postal_code);

    LVL 23

    Expert Comment

    by:Rajkumar Gs
    For SQL Server
    select * from Table1 a 
      inner join Table2 b on replace(a.postalcode, ' ', '') = b.postalcode

    Open in new window


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Creating and Managing Databases with phpMyAdmin in cPanel.
    Shadow IT is coming out of the shadows as more businesses are choosing cloud-based applications. It is now a multi-cloud world for most organizations. Simultaneously, most businesses have yet to consolidate with one cloud provider or define an offic…
    Video by: Steve
    Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now