値<> 0手段設備
SELECT DateStamp
,PropertyCode
,PropertyName
,FacilityBabyFriendly - LAG(FacilityBabyFriendly) OVER (PARTITION BY PropertyCode, PropertyName ORDER BY DateStamp) AS FacilityBabyFriendlyChanged
,FacilityDogsAccepted - LAG(FacilityDogsAccepted) OVER (PARTITION BY PropertyCode, PropertyName ORDER BY DateStamp) AS FacilityDogsAcceptedChanged
,FacilitySwimmingPool - LAG(FacilitySwimmingPool) OVER (PARTITION BY PropertyCode, PropertyName ORDER BY DateStamp) AS FacilitySwimmingPoolChanged
,FacilityHotTub - LAG(FacilityHotTub) OVER (PARTITION BY PropertyCode, PropertyName ORDER BY DateStamp) AS FacilityHotTubChanged
,FacilityInternetAccess - LAG(FacilityInternetAccess) OVER (PARTITION BY PropertyCode, PropertyName ORDER BY DateStamp) AS FacilityInternetAccessChanged
,FacilitySeaViews - LAG(FacilitySeaViews) OVER (PARTITION BY PropertyCode, PropertyName ORDER BY DateStamp) AS FacilitySeaViewsChanged
,FacilityParking - LAG(FacilityParking) OVER (PARTITION BY PropertyCode, PropertyName ORDER BY DateStamp) AS FacilityParkingChanged
FROM YourTable
を変更したとして
RDBMSとは何ですか? – Jayvee
申し訳ありませんが、私はそれはMSのSQLだと言っていたはずです。 – Claire
また、FacilityX行のデータ型は何ですか? – Jayvee