?
Solved

MySQL Query

Posted on 2013-06-14
2
Medium Priority
?
322 Views
Last Modified: 2013-06-14
What is wrong with this:

SELECT student.sid, test_results . *
FROM student
INNER JOIN test_results ON student.sid = test_results.ID
WHERE student.district_code = 'OSD'

Attached are the structures of both tables.

There are 6899 records in student where district_code = 'OSD'.

My guess is there are about 500K records in test_results that meet these criteria. The query result says returned zero.
student-table.jpg
test-results.jpg
0
Comment
Question by:Richard Korts
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 2000 total points
ID: 39249208
I think 'test_results.ID' should be 'test_results.id' and there shouldn't be any spaces in 'test_results.*'.
SELECT student.sid, test_results.*
FROM student
INNER JOIN test_results ON student.sid = test_results.id
WHERE student.district_code = 'OSD'

Open in new window

0
 

Author Comment

by:Richard Korts
ID: 39249234
My error, I had forgotten they used the uid field from student.
0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I’ll talk about multi-threaded slave statistics printed in MySQL error log file.
Backups and Disaster RecoveryIn this post, we’ll look at strategies for backups and disaster recovery.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question