Solved

MySQL Query

Posted on 2013-06-14
2
316 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
2 Comments
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 500 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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Introduction In this installment of my SQL tidbits, I will be looking at parsing Extensible Markup Language (XML) directly passed as string parameters to MySQL 5.1.5 or higher. These would be instances where LOAD_FILE (http://dev.mysql.com/doc/refm…
Foreword This is an old article.  Instead of using the MySQL extension that was used in the original code examples, please choose one of the currently supported database extensions instead.  More information is available here: MySQLi / PDO (http://…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

910 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now