Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6345295
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T20:47:43+00:00 2026-05-24T20:47:43+00:00

I’ve been working through issues that resulted from using Join-Ons instead of comma joins.

  • 0

I’ve been working through issues that resulted from using Join-Ons instead of comma joins. My SQL currently looks like this:

SELECT islandID AS parentIslandID, islandName, island.longDesc, 
imageLocation, COUNT(resort.resortID) AS totalResorts, resort.resortID 
FROM island, resort, images 
join resort as r1 
on island.islandID = resort.parentIslandID 
where 
r1.resortID IN ( 
59,62,65,69,71,72,74,75,76,82,86,89,91,93,95,105, 
106,116,117,118,120,121,122,123,124,125,126,127, 
131,145,146,150,157,159,160,167,170,174,176,185,188,189,193, 
194,198,199,200,203,205,213,217 
) 
&& resort.active = '-1' 
GROUP BY resort.parentIslandID 
ORDER BY totalResorts DESC 

When executed, I get the following error:

#1054 - Unknown column 'island.islandID' in 'on clause'

I did some research and understand the origin of the error however I’ve tried to correct the issue by creating an alias for the “island” table. When I do this, columns like “island.longDesc” are then “unknown”.

If anyone could correct what seems to be a minor syntax problem I would greatly appreciate it.

Images Structure:
CREATE TABLE `images` (
  `imageID` int(11) NOT NULL auto_increment,
  `imageType` int(11) NOT NULL COMMENT 'used to tell if its for an artist, header image, etc.',
  `parentObjectID` int(11) NOT NULL COMMENT 'used to tell what island/resort the image applies to',
  `imageLocation` text NOT NULL,
  `largeImageLocation` text NOT NULL,
  `imageLinkLabel` text NOT NULL,
  `imageURL` text NOT NULL,
  PRIMARY KEY  (`imageID`)
)

Island Structure:
CREATE TABLE `island` (
  `islandID` int(11) NOT NULL auto_increment,
  `islandName` text NOT NULL,
  `shortDesc` text NOT NULL,
  `longDesc` text NOT NULL,
  `getTo` text NOT NULL,
  `getAround` text NOT NULL,
  `photoInfo` text NOT NULL,
  `flowerInfo` text NOT NULL,
  `musicInfo` text NOT NULL,
  `cakeInfo` text NOT NULL,
  `activityInfo` text NOT NULL,
  `wedCoord` text NOT NULL,
  `regs` text NOT NULL,
  `climate` text NOT NULL,
  `languageID` int(11) NOT NULL,
  `currencyID` int(11) NOT NULL,
  `wideAccept` int(11) NOT NULL,
  `passportReq` int(11) NOT NULL,
  `picture` text NOT NULL,
  `daysSearchable` int(11) NOT NULL,
  `active` tinyint(1) NOT NULL,
  PRIMARY KEY  (`islandID`)
)

Resort Structure:
CREATE TABLE `resort` (
  `resortID` int(11) NOT NULL auto_increment,
  `resortName` text NOT NULL,
  `parentIslandID` int(11) NOT NULL,
  `longDesc` text NOT NULL,
  `website` text NOT NULL,
  `genBooking` text NOT NULL,
  `eventCoord` text NOT NULL,
  `amenInfo` text NOT NULL,
  `roomInfo` text NOT NULL,
  `coordInfo` text NOT NULL,
  `localeInfo` text NOT NULL,
  `spaInfo` text NOT NULL,
  `roomPrice` text NOT NULL,
  `maxGuests` text NOT NULL,
  `picture` text NOT NULL,
  `search_Inclusive` int(11) NOT NULL,
  `search_resortType` int(11) NOT NULL,
  `search_onBeach` int(11) NOT NULL,
  `search_wedCoord` int(11) NOT NULL,
  `search_roomRate` int(11) NOT NULL,
  `search_airportDist` int(11) NOT NULL,
  `search_HotelSuite` tinyint(1) NOT NULL,
  `search_VillaCondo` tinyint(1) NOT NULL,
  `search_Amenities` text NOT NULL,
  `active` tinyint(1) NOT NULL,
  PRIMARY KEY  (`resortID`)
)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T20:47:44+00:00Added an answer on May 24, 2026 at 8:47 pm

    You are mixing two different types of JOIN syntax – the implicit type where tables are listed in FROM, and the explicit JOIN type. Instead, try:

    SELECT
       islandID AS parentIslandID,
       islandName, 
       island.longDesc, 
       imageLocation,
       COUNT(r1.resortID) AS totalResorts, 
       r1.resortID 
    FROM island
      JOIN resort r1 ON island.islandID = r1.parentIslandID 
      JOIN images ON island.islandID = images.parentObjectID 
    WHERE 
      r1.resortID IN ( 
        59,62,65,69,71,72,74,75,76,82,86,89,91,93,95,105, 
        106,116,117,118,120,121,122,123,124,125,126,127, 
        131,145,146,150,157,159,160,167,170,174,176,185,188,189,193, 
        194,198,199,200,203,205,213,217 
      ) 
    AND resort.active = '-1' 
    GROUP BY r1.parentIslandID 
    ORDER BY totalResorts DESC 
    

    **Edited to include island JOIN after table structure was posted.

    Additionally:

    • MySQL uses AND rather than && for boolean AND
    • Table aliases do not need the AS keyword (JOIN resort r1)
    • Be sure to use your resort alias r1 in the select list (r1.resortID)
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
Does anyone know how can I replace this 2 symbol below from the string
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have a bunch of posts stored in text files formatted in yaml/textile (from
We're building an app, our first using Rails 3, and we're having to build
I am trying to loop through a bunch of documents I have to put
I'm making a simple page using Google Maps API 3. My first. One marker

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.