I have a PostgreSQL DB and have a script which calculates dates from an old Sybase DB. How can I do the same thing is PostgreSQL ?
isql
DBCOMMAND="eval isql -d $DATABASE -U user -P passwd "
$DBCOMMAND << MSG > $LOG_MEM_EXCEP
DECLARE @PREVINTDATETIME DATETIME
select @PREVINTDATETIME=(DATEADD(hh, -24, GETDATE()))
DECLARE @CURDATE DATETIME
select CURDATE=GETDATE()
select XTIME, MESSAGE from EXCEPTION_ALERTS where (XTIME between @PREVINTDATETIME AND @CURDATE)
exit MSG