473,395 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Question when using "USING" intead of "ON" with multiple LEFT JOINs - different results

Hi. I decided to tidy up some of my queries, but I came across something
that stumpt me:

mysql> SELECT
-> jobs.jobId,
-> jobs.active,
-> jobs.title,
-> jobs.listed,
-> industries.industry,
-> occupations.occupation,
-> agencies.agencyId,
-> agencies.agency,
-> contacts.contactId,
-> contacts.firstName,
-> contacts.lastName
-> FROM
-> jobs
-> LEFT JOIN industries ON jobs.industryId = industries.industryId
-> LEFT JOIN occupations ON jobs.occupationId =
occupations.occupationId
-> LEFT JOIN agencies ON jobs.agencyId = agencies.agencyId
-> LEFT JOIN contacts ON jobs.contactId = contacts.contactId;
Runs fine
mysql> SELECT
-> jobs.jobId,
-> jobs.active,
-> jobs.title,
-> jobs.listed,
-> industries.industry,
-> occupations.occupation,
-> agencies.agencyId,
-> agencies.agency,
-> contacts.contactId,
-> contacts.firstName,
-> contacts.lastName
-> FROM
-> jobs
-> LEFT JOIN industries USING (industryId)
-> LEFT JOIN occupations USING (occupationId)
-> LEFT JOIN agencies USING (agencyId)
-> LEFT JOIN contacts USING (contactId);
ERROR 1054: Unknown column 'industries.occupationId' in 'on clause'
Aren't these essentially the same statements? Or does "USING" not work the
way I think it does?
Thanks, Justin.
Jul 19 '05 #1
0 1778

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: ed | last post by:
Folks, I'm attempting to write some OOP with the use strict pragma on an I'm just not getting it to work. Here's an example #!/usr/bin/perl -w use strict; use Automobile; my $file = new...
0
by: Gavin Williams | last post by:
I am working on a multi-threaded server for a Windows 2000 system and since "fork" doesn't work that great in a Win32 environment, I am trying to use use the "threads" module instead. When a...
0
by: Justin | last post by:
Hi. I decided to tidy up some of my queries, but I came across something that stumpt me: mysql> SELECT -> jobs.jobId, -> jobs.active, -> jobs.title, -> jobs.listed, -> ...
4
by: timmy | last post by:
I have a table with a cell on the bottom right with an image to create a rounded corner effect: <table cellpadding="0" cellspacing="0" border="1"> <tr><td rowspan="2">asdfsadf</td> <td...
1
by: Amil Hanish | last post by:
I use the VS 2005 option "View in browser" to often view my web site. If I have a link in there like: <img src="/graphics/myimage.jpg"> This doesn't work even though the image is really...
0
by: Amil Hanish | last post by:
Earlier I had inquired as to why a normal <a hreftag didn't work when using the VS hosted site using a random local port. The more I think about it, this seems very wrong. Using the random port...
10
by: Eric | last post by:
Hello, I have some server side includes on a Classic asp page that look something like: <!-- #include virtual="/includes/file1.asp"--> <!-- #include virtual="/includes/file2.asp" --> <!--...
7
by: laredotornado | last post by:
Hi, Using advice from this newsgroup, I tried this JS to create new DOM elements on-the-fly var divSidebarItem = document.createElement("div"); divSideBarItem.setAttribute("class",...
1
by: Evan | last post by:
Hello - i'm trying to call subprocess.popen on the 'command-based' function in linux. When I run the command from the shell, like so: goset -f ' "%s %s" name addr ' file_name it works fine...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.