好的,所以我有一个这样的数据库设置:
Client {Clientt#, FirstName, LastName, Email, city};
RType {TName, Price, TRooms};
Location {Confirm#, Arrival, Departure, Origin, Client# (references Guest), Type (references RoomType)}
我几乎需要创建 SQL 语句,为我提供所有类型的所有客户的列表。
我写了这个,但它不起作用:
SELECT Client#, FirstName, LastName, Type
FROM Client, Location
WHERE Client.Client# = Location.Client# and Location.Type = (select count(DISTINCT TName) from RType);
有人能帮我吗?