というテーブルがありますTb_patientBeds
。
ここで、このテーブルの列に基づいて、占有、非占有、またはすべてとして設定されたレコードを取得します。status
これが私の他の列です:
patientBedID int IDENTITY(1,1) NOT NULL,
patientBedType [varchar](20) NULL,
BedCharge [varchar](20) NULL,
status [varchar](20) NULL,
私は次のようなクエリを書きました
select * from Tb_patientBeds where [status]= case
when [status]= '0'
then 'occupied'
when [status]='1'
then 'unoccupied' else 'All'
end
クエリはレコードを返していません。空のレコードを表示しています。
誰かがこの点で私を助けることができますか?