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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T06:17:28+00:00 2026-06-15T06:17:28+00:00

The following snippet is a join on multiple tables. I need to display all

  • 0

The following snippet is a join on multiple tables. I need to display all order number, customer name, product name, price and quantity ordered from anyone from Australia. I’m getting table headings but no rows. Is there something wrong with this?

SELECT 
      "order".orderno AS ord, 
      customer.cname, 
      product.prodname, 
      customer.country_code, 
      orderdetl.price, 
      orderdetl.qty, 
      country.country_code
    FROM 
      prema01.country, 
      prema01.customer, 
      prema01."order", 
      prema01.orderdetl, 
      prema01.product
    WHERE 
      customer.country_code = 'AUS'

I’ve changed the code, verified there is data in the tables and it still comes out blank.
I am completely stumped.

SELECT O.ORDERNO, C.CNAME, PN.PRODNAME, ODT.PRICE, ODT.QTY, ODT.QTY * PN.PRODSELL AS TOTAL
FROM prema01.ORDER O, prema01.CUSTOMER C, prema01.ORDERDETL ODT, prema01.PRODUCT PN, prema01.COUNTRY CT
WHERE CT.COUNTRY_NAME = 'Australia' 
AND C.COUNTRY_CODE = CT.COUNTRY_CODE 
AND C.CUSTNO = O.CUSTNO 
AND O.ORDERNO = ODT.ORDERNO 
AND PN.PRODNO = ODT.PRODNO AND O.ORDERNO <= 60
ORDER BY TOTAL DESC;

forgot to add the change. the tables have data in them, i’ve physically verified that.

  • 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-15T06:17:29+00:00Added an answer on June 15, 2026 at 6:17 am

    For starters, you need some join conditions e.g.

    Select
      r.country_code,
      c.cname
    From
      prema01.country r
        inner join
      prema01.customer c
        on r.country_code = c.country_code
    

    You need to build up the relationships with the other tables in a similar way.

    Also, are you sure your tables have any data in them. Does

    Select
      Count(*)
    From
      prema01.country
    

    return anything? How about

    Select
      Count(*)
    From
      prema01.customer
    Where
      country_code = 'AUS'
    

    ?

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

Sidebar

Related Questions

Following snippet attempts to write the name of directories and files present in some
I wrote the following snippet in order to handle errors. (Page.php gets included in
I've got the following snippet of code and its all working, and bringing in
Consider the following snippet of code: // get number of sheep in DataTable by
Note: I have removed all required error checking in the following snippet. ... void
The following snippet of code creates 4 processes, all sharing the same listening socket.
The following snippet does work for what I need. I believe though that there
I have the following snippet of PowerShell script in my profile: . (join-path (split-path
The following snippet from RuntimeUtil.java from jlibs guarantees GC that garbage collection is done.
The following snippet is not working for me. Basically I want to check if

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.