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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T15:30:28+00:00 2026-05-20T15:30:28+00:00

I am joining my address book onto my email table like this: SELECT *

  • 0

I am joining my address book onto my email table like this:

SELECT * FROM messages m
LEFT JOIN addr_book a ON 
m.to_msg LIKE a.h_email 
OR m.to_msg LIKE a.bill_email 
OR m.to_msg LIKE a.b_email 
OR m.to_msg LIKE a.w_email 
OR m.to_msg LIKE a.other_email 
OR m.from_msg LIKE a.h_email 
OR m.from_msg LIKE a.bill_email 
OR m.from_msg LIKE a.b_email 
OR m.from_msg LIKE a.w_email 
OR m.from_msg LIKE a.other_email 
OR m.cc_msg LIKE a.h_email 
OR m.cc_msg LIKE a.bill_email 
OR m.cc_msg LIKE a.b_email 
OR m.cc_msg LIKE a.w_email 
OR m.cc_msg LIKE a.other_email 
OR m.bcc_msg LIKE a.h_email 
OR m.bcc_msg LIKE a.bill_email 
OR m.bcc_msg LIKE a.b_email 
OR m.bcc_msg LIKE a.w_email 
OR m.bcc_msg LIKE a.other_email

The problem is it fetches everything, because some contacts don’t have emails and join up with emails that don’t have cc_msg=” or bcc_msg=”

Is there a way I can left join a table on a column where the column is like ‘@’??

I tried a couple things like IN (m.to_message LIKE a.h_email WHERE a.h_email LIKE '%@%') OR etc etc

But I keep getting errors.

Any ideas?

Thanks a ton!

  • 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-05-20T15:30:29+00:00Added an answer on May 20, 2026 at 3:30 pm

    Ok so that helps out alot. I don’t know why, but I have always assumed = is case sensitive in mySQL. I used the following and it works beautifully. Thanks all, I’m sure if I had proper training I wouldn’t have made this mistake in the first place lol.

    LEFT JOIN addr_book a ON 
    
    (m.to_msg=a.h_email OR m.to_msg=a.bill_email OR m.to_msg=a.b_email OR m.to_msg=a.w_email OR m.to_msg=a.other_email) OR
    
    (m.from_msg=a.h_email OR m.from_msg=a.bill_email OR m.from_msg=a.b_email OR m.from_msg=a.w_email OR m.from_msg=a.other_email) OR
    
    ((m.cc_msg!='') AND (m.cc_msg=a.h_email OR m.cc_msg=a.bill_email OR m.cc_msg=a.b_email OR m.cc_msg=a.w_email OR m.cc_msg=a.other_email)) OR 
    
    ((m.bcc_msg!='') AND (m.bcc_msg=a.h_email OR m.bcc_msg=a.bill_email OR m.bcc_msg=a.b_email OR m.bcc_msg=a.w_email OR m.bcc_msg=a.other_email))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i'm joining tables like: select * from tableA a full join tableB b on
I have two table. user and address . I am joining them like this
I am LEFT JOINing multiple tables as such: SELECT * FROM table1 LEFT JOIN
i am joining 2 tables using this query SELECT DISTINCT (member.id), member_type FROM member
I'm JOINing the results of this query: SELECT twitter_personas.id , 'TwitterPersona' , twitter_personas.name FROM
I am trying to send a sample email from my rails application. this is
I'm joining to a table dozens of different times, and every time, I join
I'm designing a contact manager/address book-like application but can't settle on the database design.
I'm designing a contact manager/address book-like application but can't settle on the database design.
I have two tables, User and Company . I have joining them like this:

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.