gpt4 book ai didi

sql - 我怎样才能得到属于 Rooms SQL 的 Roomattributes Description

转载 作者:行者123 更新时间:2023-12-04 22:23:21 25 4
gpt4 key购买 nike

我有 3 个表是我的 SQL 数据库:

First Table: Room: ID <pk>, Roomname
Second Table: RoomRelationsship: ID<pk>, Room_ID <fk>, Roomattributes_ID<fk>
Third Table: Roomattributes: ID<pk>, Attributename

如何获取属于房间的房间属性。我需要一个 SQL 查询。

提前致谢

最佳答案

SELECT Room.ID, Room.Roomname, Roomattributes.Attributename 
FROM Room
INNER JOIN RoomRelationsship ON RoomRelationsship.Room_ID = Room.ID
INNER JOIN Roomattributes ON RoomRelationsship.Roomattributes_ID = Roomattributes.ID

关于sql - 我怎样才能得到属于 Rooms SQL 的 Roomattributes Description,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11010204/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com