Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8715727
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T05:54:54+00:00 2026-06-13T05:54:54+00:00

I have searched and searched for a solution to my problem and even though

  • 0

I have searched and searched for a solution to my problem and even though I’ve found some that may help, I’m not sure it’s the right way to do it for what I need. Keep in mind I am learning and fairly new to SQL. But I have two tables I want to query using an inner join.

There is a column named CAVITY in both tables but they hold the values in different formats. One table holds the value as H02 and the other table hold the value as just 2.

I want to inner join on this column using the H02 format but don’t want to UPDATE the table that holds the value as a single number(for data entry purposes). So for example, if the one table column has H02 and the other has 2, I want it to be joined. If one table has H13 and the other 13, I want it to be a join as well. So basically, I am wanting to remove the H and 0 (but only if there is a 0 that directly follows the H). Unless there is a way to do the opposite and add the H / H0 from the results of the other table.

example data
table1.cavity   table2.cavity
     H01      =    1
     H02      =    2
     H10      =    10
     H12      =    12

It doesn’t matter to me if my query results are the H0 version or not; I just need the joins to work; I can accommodate for either result in the end.

I am using SQL Server 2005

I have the rest of the query and it works ok; I just need this extra join added. Please help! Any help is GREATLY APPRECIATED. Thank you

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T05:54:55+00:00Added an answer on June 13, 2026 at 5:54 am

    REPLACE(REPLACE(cavity,'H0',''),'H','')

    The first removes H0:

    REPLACE(cavity,'H0','')

    And then the second replaces any remaining H’s:

    REPLACE(output_of_previous,'H','')

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have searched for hours now and haven't found a solution for my problem.
I've searched google and SO for a solution to this problem but have not
I have searched for solution, but nothing similar. My problem is that I want
I have searched the web but I cannot find the solution to my problem.
I have searched online for a solution, but have yet to find one that
I have searched around and have not been able to find a solution for
I have searched the web and have found no definitive solution, so here goes:
I have searched a lot to find a solution for my problem, but I
I have searched a long time and cannot find a solution to my problem.
I have searched to find a solution to this problem without anyluck. I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.