用于搜刮具有无穷数目的位字段的表的SQL计划要领
发布时间:2021-04-01 00:19:04 所属栏目:编程 来源:网络整理
导读:思量搜刮包括公寓租赁信息的表:行使该界面的客户端选择在数据库中暗示为位字段的多个前提,譬喻: AllowPets HasParking HasDeck ModernKitchen 等等.. 我们面对的环境是,我们软件的每个新客户都有他们但愿应承最终用户搜刮的其他字段.位字段的数目可以到达数
界说表: CREATE TABLE #Apartments ( ApartmentID int not null primary key identity(1,1),ApartmentName varchar(500) not null,Status char(1) not null default ('A') --.... ) CREATE TABLE #AttributeTypes ( AttributeType smallint not null primary key,AttributeDescription varchar(500) not null ) CREATE TABLE #Attributes --boolean attributes,if row exists apartment has this attribute ( ApartmentID int not null --FK to Apartments.ApartmentID,AttributeID int not null primary key identity(1,AttributeType smallint not null --fk to AttributeTypes ) (编辑:湖南网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |