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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T00:10:06+00:00 2026-05-18T00:10:06+00:00

I have some troubles re-writing this query to using joins instead of the two

  • 0

I have some troubles re-writing this query to using joins instead of the two subqueries. I have a problem untangling it, if you know what i mean.

SELECT o.order_id, n.title, c.first_name, t1.name, o.product_id,
    (SELECT ttd2.tid FROM term_data ttd2, term_node ttn2 WHERE ttd2.vid = 5 AND ttn2.nid = p.nid AND ttd2.tid=ttn2.tid) AS tid,
    (SELECT ttd4.name FROM term_data ttd4, term_node ttn4 WHERE ttd4.vid = 8 AND ttn4.nid = p.nid AND ttd4.tid=ttn4.tid) AS month
    FROM orders o, products p, node n, customers c, term_data t1, term_node t2
    WHERE o.product_id = p.nid
    AND p.nid = n.nid
    AND o.customer_email = c.customer_email
    AND t2.tid = t1.tid
    AND t1.vid = 6
    AND n.nid = t2.nid

Can you help? Or give some clues/hints.

  • 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-18T00:10:07+00:00Added an answer on May 18, 2026 at 12:10 am

    Rewrite it using ANSI SQL-92 syntax (i.e., using JOIN and ON clauses), and it should be much more clear.

    Right now all of your JOIN and WHERE clauses are mixed together, so it is not easy to see the relationships. Subqueries are not necessarily a problem; this should become more clear once the syntax is cleaned up.

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

Sidebar

Related Questions

Im having some trouble writing a getstring function, this is what I have so
I have some troubles while writing logs from log4net to the file. I seem
I have some troubles mapping a JSON Array to RestKit. This is what the
I have some troubles with positioning my label/password field. With this code they both
Right now I have some troubles. I'm finding a way to solve one problem.
I'm having some trouble writing a query. For example: Let's say I have just
I have some troubles with my school project. I have a class: #include Group.h
I have some troubles with plotting the figure. I have a file with some
I have some troubles with getting the data from the website. The website source
I have some troubles with a method having a typed List parameter, inherited from

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.