Twitch Posted November 20, 2010 Share Posted November 20, 2010 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 Quote Link to comment https://forums.phpfreaks.com/topic/219299-multiple-table-query-help/ Share on other sites More sharing options...
Twitch Posted November 20, 2010 Author Share Posted November 20, 2010 The error was because I didn't specify a specific column in the second select query. I knew it was something simple. Quote Link to comment https://forums.phpfreaks.com/topic/219299-multiple-table-query-help/#findComment-1137291 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.