Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > MySQL
MySQL General discussion about the MySQL database.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the MySQL section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old April 24th, 2007, 04:50 PM
Registered User
Join Date: Apr 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default complex query... help plz

Old April 28th, 2007, 05:48 AM
Authorized User
Join Date: Oct 2006
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts

should it all be in one query?
You can do it in 2 steps:

1. SELECT room_Type FROM your_table_name WHERE day_Num >= '25' and day_Num <= '27' and qty = '0';

Then analize this query result in prog. language that you use, create variables with values "double" and "ensuite". Use this variables to construct the second query.

2. SELECT * FROM your_table_name WHERE room_Type != 'double' and room_Type != 'ensuite' ORDER BY qty LIMIT 1

Similar Threads
Thread Thread Starter Forum Replies Last Post
complex query g_vamsi_krish SQL Language 3 February 27th, 2006 10:48 AM
query too complex liz@trinityholdings.co.za Access 3 August 28th, 2003 09:01 AM
COMPLEX QUERY PROBLEM nikosdra SQL Server ASP 15 August 4th, 2003 06:17 PM
Complex Query-Plz Help rivinjose SQL Server 2000 10 June 27th, 2003 09:25 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.