【发布时间】:2016-11-29 22:33:51
【问题描述】:
我需要有关 sql 语句的帮助。
我正在管理一个房地产数据库。我有一张桌子属性和多张桌子卧室、浴室等。
我有一个表单,我的代理可以在列表框中看到所有属性,选择他喜欢的一个,它将在所有组合框中显示正确的信息
每个条件都显示在一个组合框中。因此,如果您显示属性 1,您会看到:卧室:1 卧室
现在我的sql语句是:
"SELECT AreaSize.AreaSizeID, AreaSize.DescriptionSurface, Bathrooms.BathroomID, Bathrooms.DescriptionBathroom, Cities.CityID, Cities.DescriptionCities, Prices.PriceID, Prices.DescriptionPrices, Properties.*, Rooms.RoomID, Rooms.DescriptionRooms, Types.TypeID, Types.DescriptionType, Users.* FROM Users INNER JOIN (Types INNER JOIN (Rooms INNER JOIN (Prices INNER JOIN (Cities INNER JOIN (Bathrooms INNER JOIN (AreaSize INNER JOIN Properties ON AreaSize.AreaSizeID = Properties.AreaSize) ON Bathrooms.BathroomID = Properties.Bathrooms) ON Cities.CityID = Properties.City) ON Prices.PriceID = Properties.Price) ON Rooms.RoomID = Properties.Rooms) ON Types.TypeID = Properties.PropertyType) ON Users.UserID = Properties.AgentID WHERE Users.email =@email";
我如何在组合框中显示:
cboBedrooms.Text = tbListing.Rows[idx]["DescriptionRooms"].ToString();
问题是现在它只显示所选属性的值,而不是所有其他值。
如果我在属性 2 中,卧室组合框仅显示:2 间卧室
它应该显示:2 间卧室,而不是单击箭头并显示 1 间卧室
+-----------------------------------------+
| Properties |
+------------+------------+---------------+
| PropertyID | NbBedrooms | AgentID... |
| 1 | 1 | 2... |
| 2 | 2 | 1... |
+------------+------------+------------+
+-------------------------+
| Bedrooms |
+------------+------------+
| PropertyID | NbBedrooms |
| 1 | 1bedroom |
| 2 | 2bedrooms |
+------------+------------+
【问题讨论】: