[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

What am I doing wrong with this INNER JOIN query?

Posted on 2012-09-19
4
Medium Priority
?
437 Views
Last Modified: 2012-09-19
Here's my query:

select regional.id, regional.first_name, regional.last_name, regional.email, regional.title, regional.city, regional.state, regional.phone, regions.google_letter, regions.regional_id from regions innner join regional on regional.id=regions.regional_id where regional.id='$assoc_id' order by regions.google_letter

The error that I'm getting is 1054: Unknown column 'regions.google_letter' in 'field list'

There is a google_letter field in the regions table, so I have not idea why that error is happening.

Where am I blowing it?
0
Comment
Question by:brucegust
  • 2
  • 2
4 Comments
 
LVL 111

Expert Comment

by:Ray Paseur
ID: 38415931
This isn't spelled correctly: innner join but I do not think that is the problem.  I  might write this part of the query differently...

from regions, regional

If you can post the CREATE TABLE script for the regions and regional tables we might be able to get a quicker answer.

Best, ~Ray
0
 
LVL 24

Accepted Solution

by:
johanntagle earned 2000 total points
ID: 38416026
It's the mispelled  innner that's the problem.  What happened here is "innner" became an alias for regions, the MySQL is now expecting you to refer to innner.google_letter.  Just correct the mispelling and you should be good to go.
0
 
LVL 111

Expert Comment

by:Ray Paseur
ID: 38416234
@johanntagle: That is exactly why I am a part of EE -- colleagues like you!
0
 
LVL 24

Expert Comment

by:johanntagle
ID: 38416238
Thanks @Ray_Paseur =)
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
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
Course of the Month19 days, 19 hours left to enroll

873 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