Jump to content

multiple table query help


Twitch

Recommended Posts

Just when I start celebrating the fact that I'm getting the hang of multiple table queries, I stall on one for a several hours again...haha

 

I am trying to determine if a venue has open tables on a certain date or not.  Each venue can have several tables. 

 

The query below gives me an error: #1241 - Operand should contain 1 column(s)

SELECT *
FROM
  venues
INNER JOIN venue_tables ON (venues.venueID = venue_tables.venueID)
  INNER JOIN cities ON (venues.cityID = cities.cityID)
  INNER JOIN states ON (venues.stateID = states.stateID)
  INNER JOIN price ON (venues.priceID = price.priceID)
WHERE venues.cityID='74' AND venue_tables.tableID NOT IN (SELECT * FROM reservations WHERE reservationDate = '2010-11-26') GROUP BY venue_tables.tableID ORDER BY venueName ASC

 

I simply want to return a list of venues that have an open table on a certain date.  I've hard coded the query for testing purposes.

 

Any help would be greatly appreciated.  I'm sure I'm missing something simple.

 

Thanks in advance,

Twitch

 

EDIT NOTE: I had to edit the venue_tables JOIN to be ON venueID instead of tableID  still get the error though

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.