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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:32:27+00:00 2026-05-29T10:32:27+00:00

This is a bit of a random question, and I’ve been doing this using

  • 0

This is a bit of a random question, and I’ve been doing this using multiple queries in MySQL and a small bit of PHP.

I have a MySQL query:

SELECT * 
FROM (reviews LEFT JOIN orders ON reviews.orderid = orders.orderid) 
LEFT JOIN customers ON orders.custid = customers.id 
WHERE customers.email = '$email'

which returns all product reviews from a specific customer.

I would like to know structure a separate query which would return all of the customer’s orders which are not yet reviewed. That is, where there is no record in the reviews table for a particular orderid.

So…

SELECT * 
FROM orders LEFT JOIN customers ON orders.custid = customers.id 
WHERE customers.email = '$email'

… which will return all customer orders, but I then want to perhaps use another WHERE clause and a LEFT JOIN so that now only orderid’s with no corresponding review records are returned. I’ve been trying to find something that will do this for some time now without any luck. Nothing seems to do the job.

As stated above, I have managed to do this using a combination of PHP/MySQL, however, it isn’t very efficient, so I wondered if anyone had any suggestions?

Thanks in advance.

Ryan

  • 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-29T10:32:27+00:00Added an answer on May 29, 2026 at 10:32 am
    SELECT * 
    FROM customers 
      JOIN orders 
        ON orders.custid = customers.id 
    WHERE customers.email = '$email' 
      AND orders.orderid NOT IN 
            ( SELECT orderid FROM reviews )
    

    … maybe

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

Sidebar

Related Questions

OK, bit of a random question, but the best way to do this is
IS this bit of code in PHP/mysql considered a stored procedure? $sql = 'SELECT
This is a bit of a random question that is more out of curiosity
I have a MySQL query that I use to retrieve random rows from a
Sorry if this is a bit random, but is it good practice to give
I have this bit of javascript written with jQuery 1.2.5. It's contained inside the
I have this bit of script to widen a text box on mouseover and
I have this bit of code I found on the web at the end
Just a random question. I'm learning a bit of Android right now, and in
This is a question about an authentication scheme. Say I have a shared secret

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.