efeerdogru
Programmer
Hi all,
Can anyone tell me why this SQL query doesn't work in mySQL? No syntax error; it works in Access.
It is a simple query. Original is more complex. Reading from another table in the brackets. But with this case, I get error. Is there a different usage in mySQL for these type of queries?
------------------------------
Select * From Hotels Where HotelID = (Select HotelID From Hotels Where HotelID = 1)
------------------------------
mySQL gives this error:
------------------------------
SQL query:
SELECT *
FROM Hotels
WHERE HotelID = (
SELECT HotelID
FROM Hotels
WHERE HotelID =1 )
LIMIT 0 , 30
MySQL result:
#1064 - You have an error in your SQL syntax near 'SELECT HotelID
FROM Hotels
WHERE HotelID =1 ) LIMIT 0, 30' at line 4
Can anyone tell me why this SQL query doesn't work in mySQL? No syntax error; it works in Access.
It is a simple query. Original is more complex. Reading from another table in the brackets. But with this case, I get error. Is there a different usage in mySQL for these type of queries?
------------------------------
Select * From Hotels Where HotelID = (Select HotelID From Hotels Where HotelID = 1)
------------------------------
mySQL gives this error:
------------------------------
SQL query:
SELECT *
FROM Hotels
WHERE HotelID = (
SELECT HotelID
FROM Hotels
WHERE HotelID =1 )
LIMIT 0 , 30
MySQL result:
#1064 - You have an error in your SQL syntax near 'SELECT HotelID
FROM Hotels
WHERE HotelID =1 ) LIMIT 0, 30' at line 4