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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T04:56:23+00:00 2026-06-05T04:56:23+00:00

I have the below sql, which if i take out the inner join to

  • 0

I have the below sql, which if i take out the inner join to the table and hard code the values, i get 2 records. But when i use the inner join statement, i just get 1 record. I am aware that with MYSQL, the like clause, is not case sensitive. Here is the sql below. I dont know why it is only returning row.

SELECT 
      a.project_code as projectCode, 
      a.project_name as projectName, 
      a.project_creation_date as projectCreationDate, 
      a.project_end_date as projectEndDate, 
      a.project_status as projectStatus      
from projects a 
inner join tmp_rec_naren8 b 
    on a.project_name like concat("%",b.expertise_desc,"%") 
    OR a.project_description like concat("%",b.expertise_desc,"%") ;

If I change the above to:

select *
from projects
where project_name like '%java%'
OR project_description like '%java%';

I get 2 rows and not 1.

Table tmp_rec_naren8 has just one column expertise_desc and contains this data:

expertise_desc
--------------
XML
Python
DWH
Java

Table projects has many columns :.. But these below are the relevant ones

    project_code sr_user_name project_name project_descriiption ..
    -----------------------------------------------------------
    1             naren5      POS          C++, XML,Java
    2             naren7      INV          Networking
    3             naren9      CCV          Java, Unix         

The first query returns 1 row:

    project_code sr_user_name project_name project_descriiption ..
    ---------------------------------------------------------------
     1            naren5       POS         C++,XML,Java

The second query returns 2 rows

    project_code sr_user_name project_name project_descriiption ..
    -----------------------------------------------------------
    1             naren5      POS          C++, XML,Java
    3             naren9      CCV          Java, Unix         
  • 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-05T04:56:25+00:00Added an answer on June 5, 2026 at 4:56 am

    One explanation would be if the value in expertise_desc contained a trailing space, ie 'Java ' (not 'Java'). Then the concat value would be '%java %', not '%java%', making a difference.

    If one of your project names ended with java, and the other had java within the name, only one would match using the join, but two would match with the non-join.

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

Sidebar

Related Questions

I have the code below which I now need to figure out how to
I'm using Sql-Server, and I have the below query which returns all columns that
I have the code below: string SQL = select * from + TableName; using
i have four tables like below in sql server 2008 : TABLE 1 ->
I have an SQL table defined as below: CREATE TABLE [TestComposite] ( ID int,
I have a Money column in my SQL Server 2008 table. In my below
I'm using MVC3 with C# code. I have a table in my SQL Server
I have the below shell script in which sql file is called which has
I have the below SQL Script which is run from Excel VBA using ADO
I have below table structure in MS SQL AirQuoteID Name SalesValue 7 M 49.50

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.