By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,335 Members | 2,218 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,335 IT Pros & Developers. It's quick & easy.

I can't get my inner join to work between two tables

P: 8
Hi all, I am using iSQL junior for a university assignment. I am struggling with an INNER JOIN

My code is

Expand|Select|Wrap|Line Numbers
  1. SELECT       w.whid, w.capacity, c.citycode, c.cityname
  2. FROM         city c
  3. INNER JOIN   warehouse w
  4. ON           C.citycode=W.citycode
  5. ORDER BY     whid ASC
  6.  
in response to the prompt:

1.12.
Write SQL Query statement to that lists the id, capacity, city code and city name of all rows in the
WAREHOUSE table in ascending warehouse id sequence.
This statement must use an inner join clause.

I have attached the assignment .PDF which includes the ER Diagram
Attached Files
File Type: pdf HIT1402_2013_S1_Ass_01_version1.1(1).pdf (176.5 KB, 533 views)
Mar 31 '13 #1

✓ answered by r035198x

The join is simple enough that it should work if there is data. Verify that there is data that meets the join condition in your tables, also use consistent case in your query. You created table aliases called c and w but you use C and W in the joins. it's unlikely to be the source of the problem but you should make your code consistent anyway.

Share this Question
Share on Google+
4 Replies


10K+
P: 13,264
So what is the problem? Does your query run? Does it show the expected results?
Mar 31 '13 #2

P: 8
Sorry, it displays "OK '0' Rows", but there should be many selected and displayed
Apr 1 '13 #3

10K+
P: 13,264
The join is simple enough that it should work if there is data. Verify that there is data that meets the join condition in your tables, also use consistent case in your query. You created table aliases called c and w but you use C and W in the joins. it's unlikely to be the source of the problem but you should make your code consistent anyway.
Apr 1 '13 #4

P: 8
Thank You, I found the issue earlier in the database code
Apr 6 '13 #5

Post your reply

Sign in to post your reply or Sign up for a free account.