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

  • Home
  • SEARCH
  • 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 6142909
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:27:06+00:00 2026-05-23T18:27:06+00:00

Sorry for the entry-level database question but I really want to learn this. I

  • 0

Sorry for the entry-level database question but I really want to learn this.

I have two tables customer_change and customer_full and I want to select rows from customer_full that same customer(same customer_id) but with different customer_points.

I wrote the following query:

SELECT * 
FROM customer_change a,customer_full b 
WHERE 
    a.ID = b.ID AND 
    a.CUSTOMER_POINTS != b.CUSTOMER_POINTS

Now it works. But it will return rows in both tables, how could I change the query to only return the rows in the second table?

Also, the returned rows may contain two rows that have the same IDs, could I modify my query to only include the first row that has this ID?

Could experts offer some help? Thanks!

  • 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-23T18:27:07+00:00Added an answer on May 23, 2026 at 6:27 pm

    The SQL inequality operator is <>, not !=. (Apologies: I note that != is supported in at least some implementations! As the comments on the question have pointed out, it seems to be a character set problem. I stand by the rest of my answer, though. :))

    That said, I recommend learning about JOIN syntax, rather than joining tables using WHERE criteria. The former lends itself to more-readable queries, and lets you exercise finer control over how the tables are joined.

    For example, your query above would be:

    SELECT * 
    FROM customer_change a
    JOIN customer_full b ON a.ID = b.ID AND a.CUSTOMER_POINTS <> b.CUSTOMER_POINTS
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Sorry if this sounds like a really stupid question, but I need to make
Sorry if this question is simple but I have been using node.js for only
Sorry for this not being a real question, but Sometime back i remember seeing
Sorry for this question. Basically I have a page where I have it automatically
Sorry if this is a newbie question. I have a VB.NET subroutine that is
Sorry if this sounds stupid but I'm really new to LiftWeb and just struggling
sorry for asking this here, but only you will know :-) I have a
Sorry for the basic question - I'm a .NET developer and don't have much
Sorry the title isn't more help. I have a database of media-file URLs that
Sorry for the second newbie question, I'm a developer not a sysadmin so 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.