| | |
Problem with MySQL Query
Please support our Database Design advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
Ok, tell me if I am correct here. WHen you query the database from the local server, you get results, but when you query it from a remote server you get an error. Is this correct?
Nobody believes the official spokesman, but everybody trusts an unidentified source.
-- Please do not PM me with questions about a thread. If you respond to a thread, then everyone can benefit.
-- Please do not PM me with questions about a thread. If you respond to a thread, then everyone can benefit.
•
•
Join Date: Apr 2005
Posts: 8
Reputation:
Solved Threads: 0
The error is as follows:
SELECT *
FROM room
WHERE room_no NOT
IN (
SELECT R.room_no
FROM room R, Booking B
WHERE R.room_no = B.room_no AND R.room_type = 'single' AND
B.arrival_date = '2005-03-16' AND B.departure_date = '2005-03-19'
)
LIMIT 0 , 30
#1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near
'SELECT R.room_no
FROM room R, Booking B
WHERE R.room_no = B.room
SELECT *
FROM room
WHERE room_no NOT
IN (
SELECT R.room_no
FROM room R, Booking B
WHERE R.room_no = B.room_no AND R.room_type = 'single' AND
B.arrival_date = '2005-03-16' AND B.departure_date = '2005-03-19'
)
LIMIT 0 , 30
#1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near
'SELECT R.room_no
FROM room R, Booking B
WHERE R.room_no = B.room
without knowing the schema, the only suggestion I can give you is to try the subquery on its own. If this doesn't work, then you have an issue with your subquery. Try the select subquery withtout the where clause. Basically, break the query down into manageable steps.
Andy
Andy
Nobody believes the official spokesman, but everybody trusts an unidentified source.
-- Please do not PM me with questions about a thread. If you respond to a thread, then everyone can benefit.
-- Please do not PM me with questions about a thread. If you respond to a thread, then everyone can benefit.
![]() |
Similar Threads
- test mysql query for no results (PHP)
- Double MySQL Query (PHP)
- Python Tuples and Mysql Query (MySQL)
- MySQL++ query question (C++)
- MySQL query's (MySQL)
- Change MySQL Query Timeout Period (MySQL)
- problem with autogenerated mysql query (MySQL)
Other Threads in the Database Design Forum
- Previous Thread: Whether my database structure is right or wrong?
- Next Thread: Creating a Database for an application
| Thread Tools | Search this Thread |





