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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T12:21:49+00:00 2026-06-17T12:21:49+00:00

Could you please help me to make this query works SELECT * FROM `SC_orders`

  • 0

Could you please help me to make this query works

SELECT *
FROM `SC_orders`
LEFT  JOIN `SC_customer_reg_fields_values`   using(customerID)
WHERE (`statusID` = 2 OR `statusID` = 3 OR `statusID` = 21 OR `statusID` = 25 OR `statusID` = 26) AND DATE(order_time) > '2012-12-01 00-00-00'
LEFT JOIN `SC_ordered_carts`
ON orderID = orderID
GROUP BY orderID

I try to combine information from 3 tables in one output. This query works fine without last LEFT JOIN and Grouping. Where is my mistake?

  • 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-17T12:21:49+00:00Added an answer on June 17, 2026 at 12:21 pm

    The where needs to be after the last join. also, the second ON clause is ambiguous and I think the group by is unnecessary since you don’t have any aggregate functions:

    SELECT *
    FROM `SC_orders`
    LEFT JOIN `SC_customer_reg_fields_values`   using(customerID)
    LEFT JOIN `SC_ordered_carts` using(orderID)
    WHERE (`statusID` = 2 OR `statusID` = 3 OR `statusID` = 21 OR `statusID` = 25 OR `statusID` = 26) AND DATE(order_time) > '2012-12-01 00-00-00'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Could you please help me make this code more in Linq style. I just
Could you please help me converting this c++ code into python: I am trying
Could someone please help me to convert this String into a Map ... String
Could someone please help explain why I can't get this to work? I properly
Could anyone please help me convert this code to vb.net, I have tried it
Would greatly appreciate it if someone could help me make this work. I'm trying
I have this regex: [\s\S-[<>]]* Could you please help me understand what does this
could someone please help me with this problem, sorry for the Language in the
I have a function to port from another language, could you please help me
Could you please help me out to find the correct deceleration rate for the

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.