如果我有以下两个表
饭店桌
HOTELID HOTEL NAME
1 PARK HOTEL
2 PARK PLAZA
3 HOLIDAY IN
房间表
HOTELID ROOMINUMBER ROOMTYPE FLOORNUMBER ROOMRATE
1 111 SINGLE 1 100
1 111 DOUBLE 1 200
1 113 DOUBLE 2 200
2 111 FAMILY 2 300
我想列出名称中包含单词的每家酒店的酒店名称、房间类型和房价PARK
,如果同一酒店的房间类型和价格相同,我只想列出一次。以下是我的代码......我需要一个子查询,我该如何绕过这个查询?
SELECT DISTINCT HOTELNAME,
DISTINCT ROOMTYPE,
DISTINCT ROOMRATE
FROM ROOM,
HOTEL
WHERE HOTELNAME LIKE '%PARK%'
GROUP BY HOTEL.HOTELNAME,
ROOMTYPE;
输出应该是
HOTEL NAME ROOMTYPE ROOMMATE
PARK HOTEL SINGLE 100
PARK HOTEL DOUBLE 200
PARK PLAZA FAMILY 300