Jump to content

Subquery Issue


DarkHouse

Recommended Posts

Hello everyone, I have a query http://sql.pastebin.com/d3398502e and it's a bit of a monster.  It's a search query for a hotel site, like expedia, but it needs the ability to get different prices for children in a room based on their age. 

 

Each hotel can have age groups, so it needs to figure out how many children are in each age group for that hotel (which works, that's all the UNIONs), and then apply the price associated with that age group to the number of children for that hotel for that date. 

 

That's where I'm stuck since the price data for that date is not available in the subquery. 

 

The way I have it now it's selecting all dates that have child prices applied and adding those together, rather than just the one date.

 

I appreciate any help I can get.  Thanks!

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.