大文字と小文字を区別して1つの列にある3つの異なる列のデータを選択したので、ここでフィルタリングしたいところがわかります。私はそれをすることができません。 解決策を持っている人なら誰でも共有できます。どのようにこのクエリで操作を実行できますか?複数の列のレコードを持つ列にwhere句を実行したいですか?出来ますか?
select
*,
case
when b.Booking_Status = 'd' then 'Draft'
when b.Booking_Status = 'r' then 'Reviewed'
when b.Booking_Status = 'a' then 'Verified'
end as Status_b,
case
when b.Booking_Status = 'd' then b.Add_By
when b.Booking_Status = 'r' then b.Review_By
when b.Booking_Status = 'a' then b.Verify_By
end as Status_By,
case
when b.Booking_Status = 'd' then b.Add_At
when b.Booking_Status = 'r' then b.Review_At
when b.Booking_Status = 'a' then b.Verify_At
end as Status_Add
from
Booking b
inner join
Booked_Units bu on b.Booking_Id = bu.BU_Booking_Id
inner join
Enq_Line e on b.Booking_Enqh_Id = e.Enql_Enqh_Id
where
Status_Add > GETDATE()
あなたは代わりに '' WHERE'のHAVING'を試したことがありますか? –
これらのdbmsタグをすべて削除しました。それらの1つを戻してください! – jarlh
質問を改善するためにこのリンクをご覧ください:https://spaghettidba.com/2015/04/24/how-to-post-at-sql-question-on-a-public-forum/ – TheGameiswar