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 9207051
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T00:18:22+00:00 2026-06-18T00:18:22+00:00

Table_1 type | description Error Some description Success Another description Table_2 type | description

  • 0
Table_1
type   |   description
Error      Some description
Success    Another description

Table_2
type   |   description
Error 1    Some description
Error 2    Another description
Error 3    Yet another description

I need to join these two tables by the type field, which is a varchar data type in both tables. The problem is that since “Error” is not the same as “Error 1” or “Error 2”, when I compare both fields, it returns empty results. I’ve tried:

select * from Table_1 a
left join Table_2 using (type)

select * from Table_2
where type in (select distinct type from Table_1)

Any help would be highly appreciated, thanks in advance

EDIT: I should be able to get results when a type in Table_1 is contained in a type in Table_2. I know it’s a little hard to get, but the thing is that in Table_1 I have generic errors for different scenarios, and Table_2 contains these same errors, but with a little more information next to them. Table_2 is filled up with data that comes from log files, and there’s pretty much anything I can do about it.

  • 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-18T00:18:23+00:00Added an answer on June 18, 2026 at 12:18 am

    Your joins should be fine. A third way:

    select * from Table_1 a
    left join Table_2 b on a.type = b.type
    

    If you’re not getting any results then the type columns’ values are not equal.

    Update

    Given that your comment states that Table_1.type is a substring of Table_2.type, you can change the join operator:

    select * from Table_1 a
    left join Table_2 b on b.type LIKE '%' + a.type + '%'
    

    This practice is not ideal. Use with caution.

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

Sidebar

Related Questions

I have this two tables: Table A ID TYPE SDATE EDATE RATING 1 M
I have table: id name type where type is 1 or 2 I need
I have two tables Table A type_uid, allowed_type_uid 9,1 9,2 9,4 1,1 1,2 24,1
I have an enumerated type field current_status in a table history in a PostgreSQL
I have the holiday table whose description are Name Null? Type HOLIDAYDATE DATE DESCRIPTION
first a quick description: I have 4 tables (1 and 3 contain a line
I am getting this error when running some unit tests (using the Test::Unit module
i have a table that has following column Type -------- type 1 type 2
I have a table which has a column called Direct of type char(1). It's
Mysql: Table_A ------------ id name 1 Name1 2 Name2 Table_B ------------ a_id type value

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.