Comments - LEAD
Content reproduced on this site is the property of its respective owners,
and this content is not reviewed in advance by MariaDB. The views, information and opinions
expressed by this content do not necessarily represent those of MariaDB or any other party.
SELECT AdmissionNo, PatientShiftDate, timestampdiff(DAY, PatientShiftDate, lead(PatientShiftDate, 1 , NOW() ) over ( order by IPDBedAllocationNo) ) as NoofStay FROM PatientBedShift
it is giving error
LEAD takes an expression and an optional offset. You seem to be adding a third argument - NOW() in the example, or CURDATE() in the error.