This my table
CREATE TABLE [dbo].[StandardRoom](
[StandardRoomId] [char](4) NOT NULL,
[RoomType] [varchar](15) NULL,
[Rate] [smallmoney] NULL,
[RoomDeparment] [varchar](15) NULL,
[PlaceNb] [char](1) NULL,
[PatientId1] [char](12) NULL,
[PatientId2] [char](12) NULL,
[PatientId3] [char](12) NULL,
[PatientId4] [char](12) NULL,
[BedId1] [char](4) NOT NULL,
[BedId2] [char](4) NULL,
[BedId3] [char](4) NULL,
[BedId4] [char](4) NULL,
[Full] [char](1) NOT NULL,
So I want to create a view to see (BedId1 if PatientId1=null), (BedId2 if PatientId2=null)
(BedId3 if PatientId3 = null), (BedId4 if PatientId4 =null)
Thank’s for helping me!
For guys voting down because They think this table is not normalize, Yes Its true , but I Have my reason to do this in the context of my DATABASE…
1 Answer