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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T19:40:15+00:00 2026-06-12T19:40:15+00:00

I wanna compare 2 tables to get data that doesn’t same. tb1 tb2 ==============

  • 0

I wanna compare 2 tables to get data that doesn’t same.

tb1              tb2
==============   ==============
|id| doc_name|   |id| doc_summ|
==============   ==============
|1 | 01180543|   |1 | 01180543|
|2 | Chord   |   ============== 
============== 

I wanna compare doc_name and doc_summ. from that example the result must be Chord.

$q = mysql_query(" SELECT t1.doc_name FROM tb1 as t1, tb2 as t2 WHERE t1.doc_name != t2.doc_summ");
while ($row = mysql_fetch_array($q)){
    $doc_copy = $row['doc_name'];
}

but the result still returns all of data. what’s wrong? 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-12T19:40:16+00:00Added an answer on June 12, 2026 at 7:40 pm

    You can join both tables using LEFT JOIN. What it does is it only display the records of table 1 if it has no match on table 2.

    SELECT  a.*
    FROM    tb1 a
            LEFT JOIN tb2 b
                ON a.doc_name = b.doc_summ
    WHERE   b.doc_summ IS NULL
    
    • SQLFiddle Demo
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wanna check sharepoint title first and see if the lib doesn't have that
I wanna compare date in linq query.i m going to get from date and
I wanna get the string representation of a variable. For example, (def my-var {})
I wanna use powershell to get all the file in sharepoint library EM_DOC_LIBRARY and
I wanna to detect an input tag that its name is: some[en] in jquery.
I wanna send /data/anr/traces.txt if app ever crashed, but the question is how can
I wanna copy some doc files from a link. But, sometimes there's link that
Hello I wanna compare two lists like this a=[1,2] b=10,20] compare(a,b) will return True
I have an int currentFontSize where I wanna compare with NSString stored in an
i wanna to write a SQL script to get the misfire jobs, There is

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.