【发布时间】:2014-03-03 20:32:23
【问题描述】:
我只想根据连接的位置获取行。要么是HOSPEDAJE 加入HOTEL,要么是HOSPEDAJE 加入APARTAMENTO,但绝不会同时出现。
我收到此错误:#1241 - Operand should contain 1 column(s)
SELECT DISTINCT(Nombre,Ciudad,Provincia,Estrellas,Tipo,null,null)
FROM hospedaje, hotel, habitacion
WHERE
hotel.hospedaje_id = hospedaje.id
AND habitacion_id = habitacion.id
UNION
SELECT DISTINCT(Nombre,Ciudad,Provincia,null,null,Disponibles,Capacidad)
FROM hospedaje, apartamento
WHERE apartamento.hospedaje_id = hospedaje.id
【问题讨论】:
标签: mysql